-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (73 loc) · 2.26 KB
/
docker.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
name: Docker image
on:
push:
branches:
- ci/docker
- main
- master
- stable*
tags:
- "v*"
env:
# DOCKER_REPO: nextcloud/whiteboard
GHCR_REPO: ghcr.io/nextcloud-releases/whiteboard
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
- linux/arm/v5
- linux/arm/v7
steps:
- name: Set vars
id: vars
run: |
echo "version=daily" >> $GITHUB_OUTPUT
echo "platform=$(echo -n ${{ matrix.platform }} | sed 's/\//-/g')" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker images
uses: docker/build-push-action@v3
with:
context: .
push: true
platforms: ${{ matrix.platform }}
tags: |
${{ env.GHCR_REPO}}:${{ steps.vars.outputs.version }}-${{ steps.vars.outputs.platform }}
release:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: build
steps:
- name: Set vars
id: vars
run: |
echo "version=daily" >> $GITHUB_OUTPUT
- name: Login to Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create GHCR manifest
run: |
docker manifest create $GHCR_REPO:${{ steps.vars.outputs.version }} \
$GHCR_REPO:${{ steps.vars.outputs.version }}-linux-amd64 \
$GHCR_REPO:${{ steps.vars.outputs.version }}-linux-arm64 \
$GHCR_REPO:${{ steps.vars.outputs.version }}-linux-arm-v5 \
$GHCR_REPO:${{ steps.vars.outputs.version }}-linux-arm-v7
- name: Push manifests
run: |
docker manifest push $DOCKER_REPO:${{ steps.vars.outputs.version }}
docker manifest push $GHCR_REPO:${{ steps.vars.outputs.version }}