-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (92 loc) · 3.01 KB
/
main.yaml
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Workflow for Images
env:
DOCKERHUB_TAG: "whyet/bambup1scam"
DOCKERHUB_SHORT_DESCRIPTION: "Docker Container for Providing the Stream of the Camera from a Bambu P1S 3D Printer"
DOCKERHUB_README_FILE: "README.md"
on:
push:
branches:
- main
jobs:
main:
name: Build & Push Docker Images
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: "amd64"
platform: "linux/amd64"
from: "debian:12"
# for the futture :)
# - arch: "arm64"
# platform: "linux/arm64"
# from: "debian:12"
# - arch: "armv7"
# platform: "linux/arm/v7"
# from: "debian:12"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.DOCKERHUB_TAG }}-${{ matrix.arch }}:latest
build-args: CI_FROM=${{ matrix.from }}
platforms: ${{ matrix.platform }}
- name: Image digests
run: |
echo image digest: ${{ steps.docker_build.outputs.digest }}
manifest:
needs: main
name: Build & Push Multiarch Manifest
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: enabled
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Create Docker manifest
run: |
docker manifest create \
${{ env.DOCKERHUB_TAG }}:latest \
--amend ${{ env.DOCKERHUB_TAG }}-amd64:latest
# --amend ${{ env.DOCKERHUB_TAG }}:arm64-latest \
# --amend ${{ env.DOCKERHUB_TAG }}:armv7-latest
- name: Push manifest to Docker Hub
run: |
docker manifest push ${{ env.DOCKERHUB_TAG }}:latest
pushreadme:
runs-on: ubuntu-latest
name: Push README to Docker Hub
steps:
- name: git checkout
uses: actions/checkout@v4
- name: push README to Dockerhub
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
with:
destination_container_repo: ${{ env.DOCKERHUB_TAG }}
provider: dockerhub
short_description: ${{ env.DOCKERHUB_SHORT_DESCRIPTION }}
readme_file: ${{ env.DOCKERHUB_README_FILE }}