-
Notifications
You must be signed in to change notification settings - Fork 17
63 lines (56 loc) · 2.9 KB
/
docker-image.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
name: Docker Image CI
on:
push:
tags:
- '*.*.*'
# branches:
# - "main"
# pull_request:
# branches: [ "main" ]
jobs:
build-on-arm64:
runs-on: ARM64
steps:
- uses: actions/checkout@v3
- name: Generate build-tag
run: echo "##[set-output name=build_tag;]$(echo ${GITHUB_REF#refs/*/})"
id: get_build_tag
- name: Build and push the Docker ARM64 image
run: |
sudo docker login -u linuxshots -p ${{ secrets.DOCKER_ACCESS_KEY }}
sudo docker build . --file Dockerfile --tag linuxshots/godaddy-ddns:arm64-${{ steps.get_build_tag.outputs.build_tag }} --no-cache --pull
sudo docker push linuxshots/godaddy-ddns:arm64-${{ steps.get_build_tag.outputs.build_tag }}
build-on-amd64:
runs-on: amd64
steps:
- uses: actions/checkout@v3
- name: Generate build-tag
run: echo "##[set-output name=build_tag;]$(echo ${GITHUB_REF#refs/*/})"
id: get_build_tag
- name: Build and push the Docker AMD64 image
run: |
sudo docker login -u linuxshots -p ${{ secrets.DOCKER_ACCESS_KEY }}
sudo docker build . --file Dockerfile --tag linuxshots/godaddy-ddns:amd64-${{ steps.get_build_tag.outputs.build_tag }} --no-cache --pull
sudo docker push linuxshots/godaddy-ddns:amd64-${{ steps.get_build_tag.outputs.build_tag }}
multiarch-push:
runs-on: ARM64
needs:
- build-on-arm64
- build-on-amd64
steps:
- uses: actions/checkout@v3
- name: Generate build-tag
run: echo "##[set-output name=build_tag;]$(echo ${GITHUB_REF#refs/*/})"
id: get_build_tag
- name: Create and push manifests
run: |
sudo docker login -u linuxshots -p ${{ secrets.DOCKER_ACCESS_KEY }}
sudo docker pull linuxshots/godaddy-ddns:amd64-${{ steps.get_build_tag.outputs.build_tag }}
sudo docker pull linuxshots/godaddy-ddns:arm64-${{ steps.get_build_tag.outputs.build_tag }}
sudo docker manifest inspect linuxshots/godaddy-ddns:${{ steps.get_build_tag.outputs.build_tag }} && sudo docker manifest rm linuxshots/godaddy-ddns:${{ steps.get_build_tag.outputs.build_tag }}
sudo docker manifest create linuxshots/godaddy-ddns:${{ steps.get_build_tag.outputs.build_tag }} --amend linuxshots/godaddy-ddns:amd64-${{ steps.get_build_tag.outputs.build_tag }} --amend linuxshots/godaddy-ddns:arm64-${{ steps.get_build_tag.outputs.build_tag }}
sudo docker manifest inspect linuxshots/godaddy-ddns:latest && sudo docker manifest rm linuxshots/godaddy-ddns:latest
sudo docker manifest create linuxshots/godaddy-ddns:latest --amend linuxshots/godaddy-ddns:amd64-${{ steps.get_build_tag.outputs.build_tag }} --amend linuxshots/godaddy-ddns:arm64-${{ steps.get_build_tag.outputs.build_tag }}
sudo docker manifest push linuxshots/godaddy-ddns:${{ steps.get_build_tag.outputs.build_tag }}
sudo docker manifest push linuxshots/godaddy-ddns:latest
sudo docker logout