-
-
Notifications
You must be signed in to change notification settings - Fork 233
46 lines (37 loc) · 1.1 KB
/
publish-image.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
44
45
46
name: Publish Image to GitHub Container Registry
on:
push:
tags:
- 'v*'
env:
REGISTRY: ghcr.io
REPOSITORY: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up docker buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Env
run: |
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Build and Push Operator image
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ env.TAG }}
${{ env.REGISTRY }}/${{ env.REPOSITORY }}:latest
platforms: linux/amd64,linux/arm64