Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Merge pull request #88 from gsainfoteam/idp #71

Merge pull request #88 from gsainfoteam/idp

Merge pull request #88 from gsainfoteam/idp #71

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