-
Notifications
You must be signed in to change notification settings - Fork 157
59 lines (48 loc) · 1.56 KB
/
docker-build-on-tag.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
58
59
name: Docker Build and Push
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/arm64,linux/amd64
push: true
tags: robustadev/krr:${{ github.ref_name }}
build-args: |
BUILDKIT_INLINE_CACHE=1
- name: Set up gcloud CLI
uses: google-github-actions/[email protected]
with:
service_account_key: ${{ secrets.GCP_SA_KEY }}
project_id: genuine-flight-317411
export_default_credentials: true
# Configure Docker to use the gcloud command-line tool as a credential helper for authentication
- name: Configure Docker
run: |-
gcloud auth configure-docker us-central1-docker.pkg.dev
- name: Verify gcloud configuration
run: |-
gcloud config get-value project
- name: Release Docker to old repo
run: |-
docker buildx build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--platform linux/arm64,linux/amd64 \
--cache-from robustadev/krr:${{ github.ref_name }} \
--tag us-central1-docker.pkg.dev/genuine-flight-317411/devel/krr:${{ github.ref_name }} \
--push \
.