-
Notifications
You must be signed in to change notification settings - Fork 29
53 lines (43 loc) · 1.7 KB
/
release.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
47
48
49
50
51
52
53
name: Release to Docker Hub
on:
release:
types:
- published
schedule:
- cron: '0 1 * * *' # every day publish a new 'latest'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: 'Set up QEMU'
uses: docker/setup-qemu-action@v3.0.0
- name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v3.0.0
- name: Get release
id: get_release
uses: bruceadams/get-release@v1.2.3
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Build and push Docker image
id: docker_build
uses: docker/build-push-action@v5.1.0
with:
platforms: linux/amd64,linux/arm64
build-args: |
chash=${{ github.sha }}
version=${{ steps.get_release.outputs.tag_name || 'latest' }}
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}:${{ steps.get_release.outputs.tag_name || 'latest' }}, ${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}