This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 1.82 KB
/
build_and_deploy.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
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Build & Deploy
on:
push:
branches:
- master
- development
jobs:
build:
uses: gsainfoteam/infoteam-infra/.github/workflows/default-docker-build.yml@master
with:
repo_name: gistalk-backend
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
deploy:
name: Deploy
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: gsainfoteam/infoteam-infra
token: ${{ secrets.INFRA_PAT }}
fetch-depth: 0
- name: Set version ENV, and commit
run: |
if [ "${GITHUB_REF_NAME}" == "master" ]; then
VERSIONS_FILE_PATH=apps/mail/gistalk-backend-stg/versions.env
else
VERSIONS_FILE_PATH=apps/mail/gistalk-backend-stg/versions.env
fi
source $VERSIONS_FILE_PATH
BACKEND_TAG="${GITHUB_REF_NAME}_${GITHUB_SHA}"
cat <<EOF > $VERSIONS_FILE_PATH
BACKEND_TAG="${BACKEND_TAG}"
EOF
git config --local user.email "[email protected]"
git config --local user.name "Github-Actions[bot] @ gsainfoteam/Gistalk-BE"
if [ "${GITHUB_REF_NAME}" == "master" ]; then
git commit -a -m "mail/gistalk-backend-stg: update version.env to ${GITHUB_SHA::7}"
else
git commit -a -m "mail/gistalk-backend-stg: update version.env to ${GITHUB_SHA::7}"
fi
- name: Push to infoteam-infra
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.INFRA_PAT }}
repository: gsainfoteam/infoteam-infra
branch: master