-
Notifications
You must be signed in to change notification settings - Fork 74
82 lines (70 loc) · 2.97 KB
/
docker-manual.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Publish to Docker Hub (Manual)
on:
workflow_dispatch:
inputs:
ref:
description: Git reference for what to push
default: master
required: true
tag:
description: Docker tag to push
default: daily
required: true
release:
description: Release Channel
default: dev
required: true
jobs:
docker-manual-build:
name: Publish docker image
strategy:
matrix:
include:
- arch: 'amd64'
dockerfile: 'Dockerfile'
- arch: 'arm64'
dockerfile: 'Dockerfile.aarch64'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: "${{ github.event.inputs.ref }}"
submodules: recursive
fetch-depth: 0 # This is set to download the full git history for the repo
- name: Get next version
id: release_info
uses: revam/gh-action-get-tag-and-version@v1
with:
branch: true
prefix: v
prefixRegex: "[vV]?"
suffix: ${{ github.event.inputs.release }}
suffixRegex: "dev|${{ github.event.inputs.release }}"
increment: suffix
- uses: docker/setup-qemu-action@v1
name: Set up QEMU
with:
platforms: arm64
if: ${{ matrix.arch == 'arm64' }}
- uses: docker/setup-buildx-action@v2
name: Set up Docker Buildx
with:
# Disable provenance for now, until it works with docker manifest create.
# The manifest list produced by the new feature is incompatible with the
# expected format used in the docker manifest create command.
provenance: false
- name: Log into docker hub
run: docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push the Docker image
run: docker buildx build . --file ${{ matrix.dockerfile }} --tag ${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }}-${{ matrix.arch }} --platform linux/${{ matrix.arch }} --build-arg version=${{ steps.release_info.outputs.version }}-${{ github.event.inputs.release }} --build-arg channel=${{ github.event.inputs.release }} --build-arg commit=${{ github.sha }} --build-arg tag=${{ steps.release_info.outputs.tag }} --push
docker-manual-push_manifest:
needs: docker-manual-build
name: Push combined tag for both images
runs-on: ubuntu-latest
steps:
- name: Log into docker hub
run: docker login --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.DOCKER_PASSWORD }}
- name: Create manifest
run: docker manifest create ${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }} --amend ${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }}-amd64 --amend ${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }}-arm64
- name: Push manifest
run: docker manifest push ${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }}