-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.67 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
on:
push:
branches: [ "main" ]
paths:
- 'Adastral.Cockatoo.WebApi/**/*'
- 'Adastral.Cockatoo.Services.WebApi/**/*'
- 'Adastral.Cockatoo.Services.WebApi.Models/**/*'
- 'Adastral.Cockatoo.Common/**/*'
- 'Adastral.Cockatoo.DataAccess/**/*'
- 'Adastral.Cockatoo.Services/**/*'
- 'Dockerfile'
- '*/Dockerfile'
- '.github/workflows/docker.yml'
jobs:
build_dev:
strategy:
matrix:
cockatoo:
- containerName: 'cockatoo-webapi'
dockerfileLocation: Dockerfile
dockerfileContext: .
tag: 'latest'
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: 'actions/checkout@v4'
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'
- name: 'Setup Artifact Registry'
shell: bash
run: gcloud auth configure-docker australia-southeast1-docker.pkg.dev
- name: 'Build Container'
shell: bash
run: docker build -t ${{ matrix.cockatoo.containerName }} -f ${{ matrix.cockatoo.dockerfileLocation }} .
- name: 'Push Container'
shell: bash
run: |
docker tag ${{ matrix.cockatoo.containerName }}:latest australia-southeast1-docker.pkg.dev/redfur/adastral/${{ matrix.cockatoo.containerName }}:${{ matrix.cockatoo.tag }}
docker push australia-southeast1-docker.pkg.dev/redfur/adastral/${{ matrix.cockatoo.containerName }}:${{ matrix.cockatoo.tag }}