-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.15 KB
/
apply.yml
File metadata and controls
46 lines (38 loc) · 1.15 KB
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
name: Apply
on:
push:
branches:
- main
workflow_dispatch:
jobs:
apply:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Auth GCloud
uses: google-github-actions/auth@v2.1.2
with:
credentials_json: ${{ secrets.CREDENTIALS }}
create_credentials_file: true
- name: Setup Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Terraform Setup
uses: hashicorp/setup-terraform@v1
- name: Terraform Init
env:
GOOGLE_CREDENTIALS: ${{ secrets.CREDENTIALS }}
run: |
terraform init \
-backend-config="bucket=${{ vars.BUCKET_NAME }}" \
-backend-config="prefix=terraform/serveless" \
-upgrade
- name: Terraform Apply
env:
GOOGLE_CREDENTIALS: ${{ secrets.CREDENTIALS }}
run: |
terraform apply -auto-approve \
-var="project_id=${{ vars.PROJECT_ID }}" \
-var="region=${{ vars.REGION }}" \
-var="zone=${{ vars.ZONE }}" \
-var="consumer=${{ vars.CONSUMER }}" \
-var="auth_url=${{ vars.AUTH_URL }}"