forked from toniebox-reverse-engineering/teddycloud
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (63 loc) · 2.18 KB
/
publish_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
name: Docker Image Publish
on:
workflow_dispatch:
push:
branches:
- master
- develop
tags:
- tc_nightly*
- tc_v*.*.*
pull_request:
branches: [ "master", "develop" ]
# permissions are needed if pushing to ghcr.io
permissions:
packages: write
jobs:
build-publish-container:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: teddycloud_meta # you'll use this in the next step
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/toniebox-reverse-engineering/teddycloud
# Docker tags based on the following events/attributes
tags: |
type=schedule
type=schedule,pattern=nightly
type=schedule,pattern={{date 'YYYYMMDD'}}
type=schedule,pattern={{date 'YYYYMMDD-hhmmss' tz='Germany/Berlin'}}
type=ref,event=branch
type=ref,event=pr
type=sha
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/tc_v') }}
type=raw,value=nightly,enable=${{ startsWith(github.ref, 'refs/tags/tc_nightly') }}
type=raw,value=nightly-develop,enable=${{ github.ref == 'refs/heads/develop' }}
type=ref,event=tag
type=match,pattern=tc_v(\d+),group=1
type=match,pattern=tc_v(\d+.\d+),group=1
type=match,pattern=tc_v(\d+.\d+.\d+),group=1
type=match,pattern=tc_v(\d+.\d+.\d+-\S+),group=1
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.teddycloud_meta.outputs.tags }}
labels: ${{ steps.teddycloud_meta.outputs.labels }}