-
Notifications
You must be signed in to change notification settings - Fork 14
69 lines (59 loc) · 2.21 KB
/
BuildDockerTask.yml
File metadata and controls
69 lines (59 loc) · 2.21 KB
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: Build docker image task
on:
workflow_call:
inputs:
push:
required: false
type: boolean
default: false
workflow_dispatch:
jobs:
get-version:
name: Get version information
uses: ./.github/workflows/GetVersionTask.yml
secrets: inherit
build-matrix:
name: Build docker matrix
runs-on: ubuntu-latest
needs: [get-version]
strategy:
matrix:
include:
- file: ./Docker/Ubuntu.Rolling.Dockerfile
platforms: linux/amd64,linux/arm64
tags: |
docker.io/ptr727/plexcleaner:${{ endsWith(github.ref, 'refs/heads/main') && 'latest' || 'develop' }}
docker.io/ptr727/plexcleaner:${{ needs.get-version.outputs.SemVer2 }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup QEMU
uses: docker/setup-qemu-action@v4
with:
platforms: linux/amd64,linux/arm64
- name: Setup Buildx
uses: docker/setup-buildx-action@v4
with:
platforms: linux/amd64,linux/arm64
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
registry: docker.io
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Docker build and push
uses: docker/build-push-action@v7
with:
context: .
push: ${{ inputs.push }}
file: ${{ matrix.file }}
tags: ${{ matrix.tags }}
platforms: ${{ matrix.platforms }}
build-args: |
LABEL_VERSION=${{ needs.get-version.outputs.SemVer2 }}
BUILD_CONFIGURATION=${{ endsWith(github.ref, 'refs/heads/main') && 'Release' || 'Debug' }}
BUILD_VERSION=${{ needs.get-version.outputs.AssemblyVersion }}
BUILD_FILE_VERSION=${{ needs.get-version.outputs.AssemblyFileVersion }}
BUILD_ASSEMBLY_VERSION=${{ needs.get-version.outputs.AssemblyFileVersion }}
BUILD_INFORMATION_VERSION=${{ needs.get-version.outputs.AssemblyInformationalVersion }}
BUILD_PACKAGE_VERSION=${{ needs.get-version.outputs.SemVer2 }}