-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (29 loc) · 1008 Bytes
/
cicd.yaml
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
name: ecom-deploy
on:
push:
branches:
- main
jobs:
build:
name: Install Ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout source repo
uses: actions/checkout@v4
- name: Login to Docker Hub
# run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASS }}
run: echo "${{ secrets.DOCKER_PASS }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Build Docker image
run: docker build -t arkostar/shirtup .
- name: Publish image to Docker Hub
run: docker push arkostar/shirtup:latest
- name: Setup Node.js
uses: actions/setup-node@v2
deploy:
needs: build
runs-on: self-hosted
steps:
- name: Pull image from Docker Hub
run: docker pull arkostar/shirtup:latest
- name: Run Docker Container
run: docker run -d -p 5000:5000 --name node-js-Ecom-container -e MOGODB_PASS= `${{ secrets.MOGODB_PASS}}` arkostar/shirtup