-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (105 loc) · 3.77 KB
/
Copy pathangularjs.yml
File metadata and controls
127 lines (105 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
# Author : Mukund Gohil
name: Angular JS CI
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# node-version: [14.x, 16.x, 18.x]
node-version: [19.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install NPM Dependencies
run: npm ci
- name: Run Unit Tests
run: npm run ci:test
continue-on-error: true
- name: Clean Distribution Directory
run: npm run ci:clean
- name: Build Application
run: npm run build --omit=dev
- name: List Files in Distribution Directory
run: ls -R ./dist
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: './dist/sample-angular-pipeline/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
# deploy:
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Setup Pages
# uses: actions/configure-pages@v3
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v1
# with:
# # Upload entire repository
# path: './dist'
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v1
# dockerize:
# name: dockerize and deploy
# needs: build
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/prod'
# env:
# DEPLOYMENT_NAME: sample-angular-pipeline
# POC_IMAGE_NAME: ghcr.io/fr-par-ashford/sample-angular-pipeline
# TAG: dev-ft-0.0.1
# REGISTRY: ghcr.io
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Build Docker Image
# run: |
# docker build --build-arg NODE_ENV="development" -t "$POC_IMAGE_NAME:$TAG" -f Dockerfile .
# docker tag $POC_IMAGE_NAME:$TAG $POC_IMAGE_NAME:latest
# - name: Push docker image to conatiner registory
# run: |
# docker login ghcr.io -u ${{ secrets.GHCR_SERVICE_ACCOUNT }} -p ${{ secrets.GHCR_SERVICE_TOKEN }}
# echo "Pushing docker image in ghcr $POC_IMAGE_NAME:$TAG"
# docker push $POC_IMAGE_NAME:$TAG