This repository was archived by the owner on Jul 23, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (60 loc) · 1.84 KB
/
container-release.yml
File metadata and controls
70 lines (60 loc) · 1.84 KB
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
60
61
62
63
64
65
66
67
68
69
70
name: Container Release
on:
push:
tags:
- v*
jobs:
build:
name: Build container on release
runs-on: ubuntu-latest
steps:
- name: Checkout code
id: checkout
uses: actions/checkout@v2
- name: Get Tag name
id: tag
if: success()
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Set up QEMU
id: qemu
if: success()
uses: docker/setup-qemu-action@v1.2.0
with:
platforms: arm64
- name: Set up Docker Buildx
id: buildx
if: success()
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
id: login-dockerhub
if: success()
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESSTOKEN }}
- name: Login to GitHub Container Registry
id: login-ghcr
if: success()
uses: docker/login-action@v1.10.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_ACCESSTOKEN }}
- name: Build and Push
id: push_dockerhub
if: success()
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: arm64
push: true
tags: |
${{ github.repository }}:latest
${{ github.repository }}:${{ steps.tag.outputs.tag }}
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ steps.tag.outputs.tag }}
- name: Image digest Docker Hub
id: digest_dockerhub
if: success()
run: echo ${{ steps.push_dockerhub.outputs.digest }}