-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.23 KB
/
publish_gcr.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
37
38
39
40
41
42
43
name: Publish image to GitHub GCR
on:
workflow_dispatch:
inputs:
image-folder:
description: 'The folder that contains the Dockerfile to build'
required: true
image-tag:
description: 'The image tag to build'
required: true
jobs:
publish_to_public_gcr:
runs-on: ubuntu-latest
steps:
- name: Build info
run: |
echo "image folder ${{ github.event.inputs.image-folder }}"
echo "image tag ${{ github.event.inputs.image-tag }}"
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Build and push
uses: docker/build-push-action@v5
with:
context: "${{ github.event.inputs.image-folder }}"
push: true
tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.inputs.image-folder }}:${{ github.event.inputs.image-tag }}