forked from decentralized-identity/dwn-server
-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (30 loc) · 986 Bytes
/
build-deploy.yaml
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 Docker Image
on:
push:
branches: ["main"]
env:
PROJECT_ID: formfree-400917
REGION: us-central1
GAR_LOCATION: us-central1-docker.pkg.dev/formfree-400917/images/dwn-server
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- id: "auth"
name: "Authenticate with Google Cloud"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}"
token_format: "access_token"
- uses: "docker/login-action@v1"
name: "Docker login"
with:
registry: "us-central1-docker.pkg.dev"
username: "oauth2accesstoken"
password: "${{ steps.auth.outputs.access_token }}"
- name: Build image
run: docker build . --tag ${{ env.GAR_LOCATION }}:${{github.sha}}
- name: Push image
run: docker push ${{ env.GAR_LOCATION }}:${{github.sha}}