Skip to content

Commit 4e2d784

Browse files
author
Ashley Bailey
authored
Merge pull request #260 from Wizarrrr/v3-beta
V3 beta
2 parents a8d0bdd + 7d7b7f8 commit 4e2d784

File tree

98 files changed

+5032
-1377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+5032
-1377
lines changed

.dockerignore

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ venv/
88
node_modules
99
__pycache__
1010

11-
# All hidden files
12-
.*
13-
1411
Dockerfile
1512
README.md
1613
babel.cfg

.github/workflows/beta-ci.yml

+237-14
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,276 @@
1-
name: Docker Build and Push
1+
name: Docker Build and Push Beta
22

33
on:
44
push:
55
branches:
6-
- v3-beta
6+
- "v3-beta"
7+
workflow_dispatch: {}
78

89
permissions:
910
packages: write
1011

1112
env:
12-
REGISTRY: ghcr.io
13+
GHCR_REGISTRY: ghcr.io
14+
DH_REGISTRY: docker.io
1315
IMAGE_NAME: wizarrrr/wizarr
1416
IMAGE_TAG: v3-beta
1517

1618
jobs:
17-
build:
19+
clear:
1820
runs-on: ubuntu-latest
21+
steps:
22+
# Clear the digests from the artifacts
23+
- name: Clear digests
24+
uses: geekyeggo/delete-artifact@v2
25+
with:
26+
name: |
27+
digests_dh
28+
digests_ghcr
29+
30+
build_ghcr:
31+
name: Build Digest for GHCR
32+
runs-on: ubuntu-latest
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
platform:
37+
- linux/amd64
38+
- linux/arm64
39+
40+
steps:
41+
# Checkout the repo
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
45+
# Get the Metadata from the Docker Image
46+
- name: Docker meta
47+
id: meta
48+
uses: docker/metadata-action@v5
49+
with:
50+
images: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
51+
52+
# Set up QEMU
53+
# - name: Set up QEMU
54+
# uses: docker/setup-qemu-action@v3
55+
# with:
56+
# platforms: ${{ matrix.platform }}
57+
58+
# Set up Docker Buildx
59+
- name: Set up Docker Buildx
60+
uses: docker/setup-buildx-action@v3
61+
62+
# Login to GHCR
63+
- name: Login to GHCR
64+
uses: docker/login-action@v3
65+
with:
66+
registry: ${{ env.GHCR_REGISTRY }}
67+
username: ${{ github.actor }}
68+
password: ${{ secrets.GITHUB_TOKEN }}
69+
70+
# Build and push the image
71+
- name: Build and push by digest
72+
id: build
73+
uses: docker/build-push-action@v5
74+
with:
75+
context: .
76+
push: true
77+
platforms: ${{ matrix.platform }}
78+
labels: ${{ steps.meta.outputs.labels }}
79+
provenance: false
80+
outputs: type=image,name=${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true
81+
cache-from: type=gha,scope=${{ matrix.platform }}-${{ env.GHCR_REGISTRY }}
82+
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}-${{ env.GHCR_REGISTRY }}
83+
84+
# Export the digest for later use
85+
- name: Export digest
86+
run: |
87+
mkdir -p /tmp/digests
88+
digest="${{ steps.build.outputs.digest }}"
89+
touch "/tmp/digests/${digest#sha256:}"
90+
91+
# Upload the digest as an artifact
92+
- name: Upload digest
93+
uses: actions/upload-artifact@v3
94+
with:
95+
name: digests_ghcr
96+
path: /tmp/digests/*
97+
if-no-files-found: error
98+
retention-days: 1
99+
100+
merge_ghcr:
101+
name: Merge Digest for GHCR
102+
runs-on: ubuntu-latest
103+
needs:
104+
- build_ghcr
19105
steps:
20106
# Checkout the repo
21107
- name: Checkout
22108
uses: actions/checkout@v2
23109

24-
# Get the Release Version from .github/latest
110+
# Get the Release Version from latest
25111
- name: Get the Release Version from latest
26112
id: get_version
27113
run: echo "::set-output name=version::$(cat latest)"
28114

115+
# Download the digests from the artifacts
116+
- name: Download digests
117+
uses: actions/download-artifact@v3
118+
with:
119+
name: digests_ghcr
120+
path: /tmp/digests
121+
29122
# Set up Docker Buildx
30123
- name: Set up Docker Buildx
31-
id: buildx
32124
uses: docker/setup-buildx-action@v3
33125

126+
# Get the Metadata from the Docker Image
127+
- name: Docker meta
128+
id: meta
129+
uses: docker/metadata-action@v5
130+
with:
131+
images: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
132+
34133
# Login to GHCR
35134
- name: Login to GHCR
36-
uses: docker/login-action@v1
135+
uses: docker/login-action@v3
37136
with:
38-
registry: ${{ env.REGISTRY }}
137+
registry: ghcr.io
39138
username: ${{ github.actor }}
40139
password: ${{ secrets.GITHUB_TOKEN }}
41140

141+
# Create manifest list and push
142+
- name: Create manifest list and push to Registry
143+
working-directory: /tmp/digests
144+
run: |
145+
docker buildx imagetools create \
146+
--tag ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} \
147+
--tag ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}-${{ steps.get_version.outputs.version }} \
148+
$(printf '${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
149+
150+
# Inspect image
151+
- name: Inspect image
152+
run: docker buildx imagetools inspect ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
153+
154+
build_dh:
155+
name: Build Digest for Docker Hub
156+
runs-on: ubuntu-latest
157+
strategy:
158+
fail-fast: false
159+
matrix:
160+
platform:
161+
- linux/amd64
162+
- linux/arm64
163+
164+
steps:
165+
# Checkout the repo
166+
- name: Checkout
167+
uses: actions/checkout@v4
168+
169+
# Get the Metadata from the Docker Image
170+
- name: Docker meta
171+
id: meta
172+
uses: docker/metadata-action@v5
173+
with:
174+
images: ${{ env.DH_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
175+
176+
# Set up QEMU
177+
# - name: Set up QEMU
178+
# uses: docker/setup-qemu-action@v3
179+
# with:
180+
# platforms: ${{ matrix.platform }}
181+
182+
# Set up Docker Buildx
183+
- name: Set up Docker Buildx
184+
uses: docker/setup-buildx-action@v3
185+
186+
# Login to Docker Hub
187+
- name: Login to Docker Hub
188+
uses: docker/login-action@v3
189+
with:
190+
registry: ${{ env.DH_REGISTRY }}
191+
username: ${{ secrets.DOCKERHUB_USERNAME }}
192+
password: ${{ secrets.DOCKERHUB_TOKEN }}
193+
42194
# Build and push the image
43-
- name: Build and push
195+
- name: Build and push by digest
196+
id: build
44197
uses: docker/build-push-action@v5
45198
with:
46199
context: .
47-
file: ./Dockerfile
48200
push: true
49-
tags: |
50-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
51-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}-${{ steps.get_version.outputs.version }}
52-
platforms: linux/amd64,linux/arm64
201+
platforms: ${{ matrix.platform }}
202+
labels: ${{ steps.meta.outputs.labels }}
53203
provenance: false
204+
outputs: type=image,name=${{ env.DH_REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true
205+
cache-from: type=gha,scope=${{ matrix.platform }}-${{ env.GHCR_REGISTRY }}
206+
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}-${{ env.GHCR_REGISTRY }}
207+
208+
# Export the digest for later use
209+
- name: Export digest
210+
run: |
211+
mkdir -p /tmp/digests
212+
digest="${{ steps.build.outputs.digest }}"
213+
touch "/tmp/digests/${digest#sha256:}"
214+
215+
# Upload the digest as an artifact
216+
- name: Upload digest
217+
uses: actions/upload-artifact@v3
218+
with:
219+
name: digests_dh
220+
path: /tmp/digests/*
221+
if-no-files-found: error
222+
retention-days: 1
223+
224+
merge_dh:
225+
name: Merge Digest for Docker Hub
226+
runs-on: ubuntu-latest
227+
needs:
228+
- build_dh
229+
steps:
230+
# Checkout the repo
231+
- name: Checkout
232+
uses: actions/checkout@v2
233+
234+
# Get the Release Version from latest
235+
- name: Get the Release Version from latest
236+
id: get_version
237+
run: echo "::set-output name=version::$(cat latest)"
238+
239+
# Download the digests from the artifacts
240+
- name: Download digests
241+
uses: actions/download-artifact@v3
242+
with:
243+
name: digests_dh
244+
path: /tmp/digests
245+
246+
# Set up Docker Buildx
247+
- name: Set up Docker Buildx
248+
uses: docker/setup-buildx-action@v3
249+
250+
# Get the Metadata from the Docker Image
251+
- name: Docker meta
252+
id: meta
253+
uses: docker/metadata-action@v5
254+
with:
255+
images: ${{ env.DH_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
256+
257+
# Login to Docker Hub
258+
- name: Login to Docker Hub
259+
uses: docker/login-action@v3
260+
with:
261+
registry: docker.io
262+
username: ${{ secrets.DOCKERHUB_USERNAME }}
263+
password: ${{ secrets.DOCKERHUB_TOKEN }}
264+
265+
# Create manifest list and push
266+
- name: Create manifest list and push to Registry
267+
working-directory: /tmp/digests
268+
run: |
269+
docker buildx imagetools create \
270+
--tag ${{ env.DH_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} \
271+
--tag ${{ env.DH_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}-${{ steps.get_version.outputs.version }} \
272+
$(printf '${{ env.DH_REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
273+
274+
# Inspect image
275+
- name: Inspect image
276+
run: docker buildx imagetools inspect ${{ env.DH_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}

.github/workflows/ci.yml

-66
This file was deleted.

.github/workflows/delete-tag.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Cleanup Untagged Images
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Tag of the image"
8+
required: true
9+
10+
jobs:
11+
delete-untagged-images:
12+
name: Delete Untagged Images
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: bots-house/[email protected]
16+
with:
17+
# NOTE: at now only orgs is supported
18+
owner: bots-house
19+
name: some-web-service
20+
# NOTE: using Personal Access Token
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
tag: ${{ github.event.inputs.tag }}

0 commit comments

Comments
 (0)