-
-
Notifications
You must be signed in to change notification settings - Fork 384
73 lines (62 loc) · 2.03 KB
/
docker_latest.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
name: Publish Docker Latest
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'src/**'
- 'docker/**'
- 'PelotonToGarmin.sln'
- 'configuration.example.json'
- '.github/workflows/docker_latest.yml'
jobs:
create_docker_images:
name: Publish Docker Images - Latest
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile: ['Dockerfile.console', 'Dockerfile.api', 'Dockerfile.webui']
include:
- dockerfile: 'Dockerfile.console'
tag: 'console-latest'
- dockerfile: 'Dockerfile.api'
tag: 'api-latest'
- dockerfile: 'Dockerfile.webui'
tag: 'webui-latest'
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
platforms: linux/amd64,linux/arm64,linux/arm/v7
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_PACKAGE_SECRET }}
- name: Prepare env
run: |
echo "BUILD_VERSION=${GITHUB_RUN_NUMBER}-${GITHUB_RUN_ID}" >> $GITHUB_ENV
- name: Build & Push to Package Repositories
id: docker_build
uses: docker/build-push-action@v3
with:
push: true
file: ./docker/${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
build-args: VERSION=${{ env.BUILD_VERSION }}
tags: |
${{ secrets.DOCKER_USERNAME }}/peloton-to-garmin:${{ matrix.tag }}
ghcr.io/${{ github.repository_owner }}/peloton-to-garmin:${{ matrix.tag }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}