-
Notifications
You must be signed in to change notification settings - Fork 576
67 lines (53 loc) · 1.92 KB
/
docker-build.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
# This workflow will run docker multi platform build
# It runs on merges to master and pull requests because it is very long
name: Docker Build
on:
push:
branches: [ master ]
pull_request:
# branches: [ master ]
workflow_dispatch:
jobs:
get_version:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Retrieve version and Changelog
id: get_version
run: |
echo icloudpd_version=$(cat pyproject.toml | grep version= | cut -d'"' -f 2) >> $GITHUB_OUTPUT
echo 'icloudpd_changelog<<EOF' >> $GITHUB_OUTPUT
scripts/extract_releasenotes CHANGELOG.md >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Log version and Changelog
run: |
echo "icloudpd_version=${{steps.get_version.outputs.icloudpd_version}}"
echo "icloudpd_changelog=${{steps.get_version.outputs.icloudpd_changelog}}"
outputs:
icloudpd_version: ${{steps.get_version.outputs.icloudpd_version}}
icloudpd_changelog: ${{steps.get_version.outputs.icloudpd_changelog}}
build_docker:
runs-on: ubuntu-22.04
needs: [get_version]
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
- name: Builder instance name
run: echo ${{ steps.buildx.outputs.name }}
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Build Release Docker
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
push: false
tags: |
icloudpd/icloudpd:latest
icloudpd/icloudpd:${{needs.get_version.outputs.icloudpd_version}}