Skip to content

Commit 8b68c77

Browse files
committed
feat: standardised workflow
1 parent 374866d commit 8b68c77

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

.github/workflows/deploy.yaml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Continuous Deployment for backend
1+
name: Continuous Deployment Pipeline for backend
22

33
on:
44
push:
@@ -8,66 +8,66 @@ on:
88
- 'backend/**'
99

1010
jobs:
11-
pull:
12-
name: Pull Stage
11+
push:
12+
name: Push Stage
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- name: Sync with remote repository
16+
- name: Sync local repo with remote repo
1717
uses: appleboy/ssh-action@master
1818
env:
19-
IQPS_DIR: ${{ secrets.IQPS_DIR }}
19+
PROJECT_DIR: ${{ secrets.PROJECT_DIR }}
2020
with:
21-
host: ${{ secrets.HOSTNAME }}
22-
username: ${{ secrets.USERNAME }}
21+
host: ${{ secrets.SSH_HOSTNAME }}
22+
username: ${{ secrets.SSH_USERNAME }}
2323
key: ${{ secrets.SSH_PRIVATE_KEY }}
24-
passphrase: ${{ secrets.PASSPHRASE }}
25-
envs: IQPS_DIR
24+
passphrase: ${{ secrets.SSH_PRIVATE_KEY_PASSPHRASE }}
25+
envs: PROJECT_DIR
2626
script_stop: true
2727
script: |
28-
cd "${IQPS_DIR}/"
28+
cd "${PROJECT_DIR}/"
2929
sudo git fetch origin
3030
sudo git reset --hard origin/main
3131
3232
build:
3333
name: Build Stage
34-
needs: pull
34+
needs: push
3535
runs-on: ubuntu-latest
3636

3737
steps:
38-
- name: Build the latest docker container
38+
- name: Build the latest container(s)
3939
uses: appleboy/ssh-action@master
4040
env:
41-
IQPS_DIR: ${{ secrets.IQPS_DIR }}
41+
PROJECT_DIR: ${{ secrets.PROJECT_DIR }}
4242
with:
43-
host: ${{ secrets.HOSTNAME }}
44-
username: ${{ secrets.USERNAME }}
43+
host: ${{ secrets.SSH_HOSTNAME }}
44+
username: ${{ secrets.SSH_USERNAME }}
4545
key: ${{ secrets.SSH_PRIVATE_KEY }}
46-
passphrase: ${{ secrets.PASSPHRASE }}
47-
envs: IQPS_DIR
46+
passphrase: ${{ secrets.SSH_PRIVATE_KEY_PASSPHRASE }}
47+
envs: PROJECT_DIR
4848
script_stop: true
4949
script: |
50-
cd "${IQPS_DIR}/backend/"
50+
cd "${PROJECT_DIR}/backend/"
5151
sudo docker compose build
5252
5353
deploy:
5454
name: Deploy Stage
55-
needs: [pull, build]
55+
needs: [push, build]
5656
runs-on: ubuntu-latest
5757

5858
steps:
59-
- name: Deploy the latest build
59+
- name: Deploy the latest build(s)
6060
uses: appleboy/ssh-action@master
6161
env:
62-
IQPS_DIR: ${{ secrets.IQPS_DIR }}
62+
PROJECT_DIR: ${{ secrets.PROJECT_DIR }}
6363
with:
64-
host: ${{ secrets.HOSTNAME }}
65-
username: ${{ secrets.USERNAME }}
64+
host: ${{ secrets.SSH_HOSTNAME }}
65+
username: ${{ secrets.SSH_USERNAME }}
6666
key: ${{ secrets.SSH_PRIVATE_KEY }}
67-
passphrase: ${{ secrets.PASSPHRASE }}
68-
envs: IQPS_DIR
67+
passphrase: ${{ secrets.SSH_PRIVATE_KEY_PASSPHRASE }}
68+
envs: PROJECT_DIR
6969
script_stop: true
7070
script: |
71-
cd "${IQPS_DIR}/backend/"
71+
cd "${PROJECT_DIR}/backend/"
7272
sudo docker compose down
7373
sudo docker compose up -d

0 commit comments

Comments
 (0)