-
Notifications
You must be signed in to change notification settings - Fork 26
78 lines (77 loc) · 3.02 KB
/
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
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
name: Releases
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
# The following is a clone of cs3org/reva/.github/workflows/docker.yml because reusable actions do not (yet) support lists as input types:
# see https://github.com/community/community/discussions/11692
release:
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'cs3org/wopiserver'] }}
strategy:
fail-fast: false
matrix:
include:
- file: wopiserver.Dockerfile
tags: ${{ vars.DOCKERHUB_ORGANIZATION }}/wopiserver:${{ github.ref_name }}-amd64
platform: linux/amd64
image: python:3.11-alpine
push: ${{ github.event_name != 'workflow_dispatch' }}
- file: wopiserver.Dockerfile
tags: ${{ vars.DOCKERHUB_ORGANIZATION }}/wopiserver:${{ github.ref_name }}-arm64
platform: linux/arm64
image: python:3.10-slim-buster
push: ${{ github.event_name != 'workflow_dispatch' }}
- file: wopiserver-xrootd.Dockerfile
tags: ${{ vars.DOCKERHUB_ORGANIZATION }}/wopiserver:${{ github.ref_name }}-xrootd
platform: linux/amd64
push: ${{ github.event_name != 'workflow_dispatch' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
if: matrix.platform != ''
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
if: matrix.push
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build ${{ matrix.push && 'and push' || '' }} ${{ matrix.tags }} Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ${{ matrix.file }}
tags: ${{ matrix.tags }}
push: ${{ matrix.push }}
build-args: |
VERSION=${{ github.ref_name }}
BASEIMAGE=${{ matrix.image }}
platforms: ${{ matrix.platform }}
manifest:
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'cs3org/wopiserver'] }}
needs: release
if: github.event_name != 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
manifest:
- ${{ vars.DOCKERHUB_ORGANIZATION }}/wopiserver:${{ github.ref_name }}
- ${{ vars.DOCKERHUB_ORGANIZATION }}/wopiserver:latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create manifest
run: |
docker manifest create ${{ matrix.manifest }} \
--amend ${{ vars.DOCKERHUB_ORGANIZATION }}/wopiserver:${{ github.ref_name }}-amd64 \
--amend ${{ vars.DOCKERHUB_ORGANIZATION }}/wopiserver:${{ github.ref_name }}-arm64
- name: Push manifest
run: docker manifest push ${{ matrix.manifest }}