-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (82 loc) · 3.05 KB
/
docker_dispatch.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
77
78
79
80
81
82
83
84
85
name: Docker
on:
workflow_dispatch:
permissions:
packages: write
jobs:
docker-build:
name: Docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: download binaries
uses: robinraju/[email protected]
id: dl
with:
latest: true
tarBall: true
zipBall: false
- name: extract binaries
run: |
tar -xzvf awsbck-v*-linux-x64.tar.gz && mkdir linux_amd64 && mv awsbck linux_amd64/awsbck
tar -xzvf awsbck-v*-linux-aarch64.tar.gz && mkdir linux_arm64 && mv awsbck linux_arm64/awsbck
tar -xzvf awsbck-v*-linux-armv7.tar.gz && mkdir linux_arm && mv awsbck linux_arm/awsbck
- name: semver
id: semver
run: |
VERSION=$(echo "${{steps.dl.outputs.tag_name}}" | sed -e 's/^v//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
MAJOR=`echo $VERSION | cut -d. -f1`
echo "major=$MAJOR" >> $GITHUB_OUTPUT
MINOR=`echo $VERSION | cut -d. -f2`
echo "minor=$MINOR" >> $GITHUB_OUTPUT
REVISION=`echo $REVISION | cut -d. -f3`
echo "revision=$REVISION" >> $GITHUB_OUTPUT
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata root
id: meta-root
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/awsbck
flavor: |
latest=false
tags: |
type=raw,value=root-${{steps.semver.outputs.major}},enable=${{ steps.semver.outputs.major != '0' }}
type=raw,value=root-${{steps.semver.outputs.major}}.${{steps.semver.outputs.minor}}
type=raw,value=root-${{steps.semver.outputs.version}}
type=raw,value=root-latest
- name: Build and push root
uses: docker/build-push-action@v6
with:
push: true
context: .
file: Dockerfile.root
tags: ${{ steps.meta-root.outputs.tags }}
labels: ${{ steps.meta-root.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/awsbck
flavor: |
latest=true
tags: |
type=raw,value=${{steps.semver.outputs.major}},enable=${{ steps.semver.outputs.major != '0' }}
type=raw,value=${{steps.semver.outputs.major}}.${{steps.semver.outputs.minor}}
type=raw,value=${{steps.semver.outputs.version}}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v7