File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Node.js CI/CD
1+ name : Docker Image CI
22
33on :
44 push :
5- branches : [ main ]
6- pull_request :
7- branches : [ main ]
5+ tags :
6+ - ' *' # Triggers on any tag push
87
98jobs :
10- build-deploy :
11- runs-on : node:20-bookworm-slim
9+ build :
10+ runs-on : ubuntu-latest
1211
1312 steps :
14- - name : Checkout Code
15- uses : actions/checkout@v4
13+ - uses : actions/checkout@v4
1614
17- - name : Setup Node.js
18- uses : actions/setup-node@v4
19- with :
20- node-version : ' v18.17.0'
15+ - name : Log in to Docker Hub
16+ run : echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
2117
22- - name : Install Dependencies
23- run : npm install
18+ - name : Build the Docker image
19+ run : docker build . -f Dockerfile -t shreyasnayak21/nodejs-faas:${{ github.ref_name }}
2420
25- - name : Run Build (optional)
26- run : npm run build
27-
28- - name : Run Tests (optional)
29- run : npm test
30-
31- Optional : Docker image build & push
32- - name : Build Docker Image
33- run : docker build -t shreyasnayak21/nodejs-faas:beta .
34-
35- # - name: Push to DockerHub or GHCR
36- # run: echo "push step here"
37-
38- # Example Deploy: rsync to server (update credentials & IP)
39- # - name: Deploy to Server
40- # run: rsync -avz ./ user@your-server-ip:/opt/nodejs-faas/
41- # env:
42- # SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
21+ - name : Push Docker image
22+ run : docker push shreyasnayak21/nodejs-faas:${{ github.ref_name }}
Original file line number Diff line number Diff line change 2424 value : " 1X2A0p84VmmLF3NYz3uHPx1hLuhT2U24"
2525 volumeMounts :
2626 - name : functions-volume
27- mountPath : /opt/app/storage/functions
27+ mountPath : /opt/app/storage
2828 volumes :
2929 - name : functions-volume
3030 persistentVolumeClaim :
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ metadata:
66 traefik.ingress.kubernetes.io/router.entrypoints : web
77spec :
88 rules :
9- - host : faas.homelab.sunitha.local
9+ - host : faas.production.k3s.txcontact.com
1010 http :
1111 paths :
1212 - path : /
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ metadata:
66 traefik.ingress.kubernetes.io/router.entrypoints : web
77spec :
88 rules :
9- - host : faas.homelab.sunitha.local
9+ - host : faas.staging.k3s.txcontact.com
1010 http :
1111 paths :
1212 - path : /
You can’t perform that action at this time.
0 commit comments