-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 1.09 KB
/
build.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
name: Build and Deploy to Cloud Run
on:
pull_request:
branches:
- main
types:
- closed
jobs:
build-and-deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
environment:
name: production
url: ${{ steps.deploy.outputs.url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
# Configure Workload Identity Federation and generate an access token.
#
# See https://github.com/google-github-actions/auth for more options,
# including authenticating via a JSON credentials file.
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_KEY }}
- name: Configure Docker
run: gcloud auth configure-docker
- name: Build Docker image
run: |
docker build -t gcr.io/dfg-analytics-insights-prod/fred_data:latest .
- name: Push Docker image to GCR
run: |
docker push gcr.io/dfg-analytics-insights-prod/fred_data:latest