-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (49 loc) · 1.33 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Push to Artifact Registry
on:
push:
branches:
- 'main'
- 'releases/**'
tags:
- '*'
env:
IMAGE_NAME: 'hyleoof'
PROJECT_ID: 'hyle-413414'
AR_REPO_LOCATION: 'europe-west3'
AR_URL: 'europe-west3-docker.pkg.dev/hyle-413414/hyle-docker'
SERVICE_ACCOUNT: 'github-actions-service-account@hyle-413414.iam.gserviceaccount.com'
WORKLOAD_IDENTITY_PROVIDER: ''
jobs:
build_and_push:
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
strategy:
matrix:
suffix:
- server
- ui
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.AR_URL }}/${{ env.IMAGE_NAME }}-${{ matrix.suffix }}
- name: Docker Auth
id: docker-auth
uses: 'docker/login-action@v3'
with:
username: _json_key
password: ${{ secrets.GOOGLE_CREDENTIALS }}
registry: '${{ env.AR_REPO_LOCATION }}-docker.pkg.dev'
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
context: .
file: Dockerfile.${{ matrix.suffix }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}