-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (32 loc) · 1021 Bytes
/
docker.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
name: Build and deploy Docker
on:
push:
branches:
- main
paths:
- '.docker/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
ENV_PATH: staging
ROOT_DIR: ${{ github.workspace }}
GITHUB_TOKEN: ${{ secrets.GIT_PAT_TOKEN }}
ASSETS_BUCKET: ${{ secrets.ASSETS_BUCKET }}
TERRAFORM_KEY: ${{ secrets.TERRAFORM_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Google credentials
run: |
echo -n "${TERRAFORM_KEY}" > "${ROOT_DIR}/google-credentials.json"
echo "GOOGLE_CREDENTIALS_PATH=${ROOT_DIR}/google-credentials.json" >> $GITHUB_ENV
shell: bash
- name: Build
env:
GOOGLE_CREDENTIALS_PATH: ${{ env.GOOGLE_CREDENTIALS_PATH }}
run: |
chmod +x "${ROOT_DIR}/terraform/environments/${ENV_PATH}/build.sh"
"${ROOT_DIR}/terraform/environments/${ENV_PATH}/build.sh" --github-actions --docker-only
shell: bash