-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 2.13 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
name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Nightly to capture latest base image and transmission version
schedule:
- cron: '* 21 * * *'
# Run tests for any PRs.
pull_request:
# Allow to trigger manually from github ui
workflow_dispatch:
jobs:
dockerhub-registry:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Transmission version
id: version
run: |
TRANSMISSION_VERSION=$(docker run --rm -i alpine:edge sh -c 'apk update -q && apk search -x transmission-daemon' | awk -F[-] '{print $3}')
TRANSMISSION_MAJOR_VERSION=${TRANSMISSION_VERSION%.*}
echo "::set-output name=full::$TRANSMISSION_VERSION"
echo "::set-output name=major::$TRANSMISSION_MAJOR_VERSION"
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
tingvarsson/transmission
flavor: |
latest=true
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=raw,value=${{ steps.version.outputs.full }}
type=raw,value=${{ steps.version.outputs.short }}
type=raw,value=${{ steps.version.outputs.major }}
type=sha,format=long,prefix=
labels: |
org.opencontainers.image.version=${{ steps.version.outputs.full }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to Docker Hub
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}