File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed
Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CI/CD Pipeline
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ pull_request :
7+ branches : [ main ]
8+
9+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10+ permissions :
11+ contents : read
12+ packages : write
13+
14+ jobs :
15+ build-and-push :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - name : Set up Node.js
21+ uses : actions/setup-node@v4
22+ with :
23+ node-version : ' 20'
24+ cache : ' npm'
25+
26+ - name : Install dependencies
27+ run : npm ci
28+
29+ - name : Build
30+ run : npm run build
31+
32+ - name : Docker meta
33+ id : meta
34+ uses : docker/metadata-action@v5
35+ with :
36+ images : ghcr.io/trafficgcn/refarch-templates/refarch-webcomponent
37+ tags : |
38+ type=ref,event=branch
39+ type=ref,event=pr
40+ type=semver,pattern={{version}}
41+ type=semver,pattern={{major}}.{{minor}}
42+ type=sha,format=long
43+
44+ - name : Login to GitHub Container Registry
45+ uses : docker/login-action@v3
46+ with :
47+ registry : ghcr.io
48+ username : ${{ github.actor }}
49+ password : ${{ secrets.GITHUB_TOKEN }}
50+
51+ - name : Build and push Docker image
52+ uses : docker/build-push-action@v5
53+ with :
54+ context : ./refarch-webcomponent
55+ push : true
56+ tags : ${{ steps.meta.outputs.tags }}
57+ labels : ${{ steps.meta.outputs.labels }}
58+ cache-from : type=gha
59+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments