-
Notifications
You must be signed in to change notification settings - Fork 15
48 lines (40 loc) · 1.39 KB
/
docker-hub-release.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
# Copied from https://github.com/matrix-org/matrix-bifrost/blob/develop/.github/workflows/docker-hub-release.yml
name: "Docker Hub - Release"
on:
release:
types: [published]
env:
DOCKER_NAMESPACE: gnuxie
PLATFORMS: linux/amd64,linux/arm64
jobs:
docker-release:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Get release tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Unshallow for git describe so we can create version.txt
run: git fetch --prune --unshallow --tags --all --force
- name: Prepare version file
run: git describe > version.txt
# Needed for multi platform builds
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
${{ env.DOCKER_NAMESPACE }}/draupnir:${{ env.RELEASE_VERSION }}
${{ env.DOCKER_NAMESPACE }}/draupnir:latest