-
Notifications
You must be signed in to change notification settings - Fork 74
117 lines (103 loc) · 3.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Publish to Docker Hub (Manual)
on:
workflow_dispatch:
inputs:
ref:
description: Git Reference
default: master
required: true
tag:
description: Docker Tag
default: daily
required: true
release:
description: Release Channel
default: dev
required: true
version:
description: Application Version
default: "0.0.0.0"
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: Replace Sentry DSN and other keys
shell: pwsh
run: |
./.github/workflows/ReplaceSentryDSN.ps1 -dsn ${{ secrets.SENTRY_DSN }}
./.github/workflows/ReplaceAVD3URL.ps1 -url ${{ secrets.AVD3_URL }}
- uses: docker/setup-qemu-action@v2
name: Set up QEMU
with:
platforms: arm64
if: ${{ matrix.arch == 'arm64' }}
- uses: docker/setup-buildx-action@v2
name: Set up Docker Buildx
- uses: docker/login-action@v2
name: Log into GitHub Container Registry
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/login-action@v2
name: Log into Docker Hub
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Disabled 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.
- uses: docker/build-push-action@v4
name: Build and Push the Docker image
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: |
ghcr.io/${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }-${{ matrix.arch }}
${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }-${{ matrix.arch }}
platforms: linux/${{ matrix.arch }}
build-args: |
version=${{ github.event.inputs.version }}
channel=${{ github.event.inputs.release }}
commit=${{ github.sha }}
date=$(git log -1 --format="%aI")
provenance: false
docker-manual-push_manifest:
needs: docker-manual-build
name: Push combined tag for both images
runs-on: ubuntu-latest
steps:
- uses: docker/login-action@v2
name: Log into GitHub Container Registry
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/login-action@v2
name: Log into Docker Hub
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create manifest
run: |
docker manifest create ghcr.io/${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }} --amend ghcr.io/${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }}-amd64 --amend ghcr.io/${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }}-arm64
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 ghcr.io/${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }}
docker manifest push ${{ secrets.DOCKER_REPO }}:${{ github.event.inputs.tag }}