-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
69 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: deploy | ||
on: release | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-20.04 | ||
defaults: | ||
run: | ||
working-directory: ./infrastructure | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@master | ||
with: | ||
service_account_key: ${{ secrets.GCP_SA_KEY }} | ||
project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
export_default_credentials: true | ||
|
||
- name: Install Terraform | ||
uses: hashicorp/setup-terraform@v1 | ||
with: | ||
terraform_version: 0.14.3 | ||
# Reason: https://github.com/hashicorp/setup-terraform/issues/20 | ||
terraform_wrapper: false | ||
|
||
- name: Terraform format | ||
id: fmt | ||
run: terraform fmt -check | ||
|
||
- name: Terraform init | ||
id: init | ||
run: terraform init | ||
|
||
- name: Terraform validate | ||
id: validate | ||
run: terraform validate -no-color | ||
|
||
- name: Terraform plan | ||
id: plan | ||
run: make plan-infrastructure | ||
working-directory: . | ||
|
||
- name: Terraform update | ||
run: make update-infrastructure | ||
working-directory: . | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
working-directory: . | ||
|
||
- name: Load cached node_modules | ||
uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install dependencies | ||
run: yarn install --prefer-offline --frozen-lockfile | ||
working-directory: . | ||
|
||
- name: Deploy to Kubernetes | ||
run: make deploy | ||
working-directory: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters