-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (42 loc) · 1.33 KB
/
CD.yml
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
name: CD pipeline
on:
push:
branches:
- main
env:
IMAGE_NAME: hiqidas
IMAGE_TAG: main
DEPLOY_REPO: dev-deploy
SIDE: backend
jobs:
deploy:
name: Push to Deploy Repository
runs-on: ubuntu-latest
steps:
- name: Setup SSH Key
run: |
echo "${{ secrets.DEPLOY_KEY_DEPLOYER }}" > ~/deploy_key
chmod 600 ~/deploy_key
- name: Clone deployer Repository
env:
GIT_SSH_COMMAND: ssh -i ~/deploy_key -o StrictHostKeyChecking=no -F /dev/null
run: |
git clone [email protected]:hackathon-21winter-05/HiQidas_deployer.git
mv HiQidas_deployer/* HiQidas_deployer/.[^\.]* .
- name: Setup
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "hackathon-21winter-05"
- name: Make log file
run: |
mkdir -p deploy-log/${{ env.SIDE }}
echo "Deployment of ${{ env.SIDE }}-${{ github.sha }}" >> deploy-log/${{ env.SIDE }}/${{ github.sha }}.txt
- name: Commit
run: |
git add .
git commit -m "Requesting deployment of ${{ env.SIDE }}-${{ github.sha }}"
- name: Push
env:
GIT_SSH_COMMAND: ssh -i ~/deploy_key -o StrictHostKeyChecking=no -F /dev/null
run: |
git push -f