-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actions update and small fixes (#152)
- Loading branch information
1 parent
5005575
commit 4505c4d
Showing
2 changed files
with
24 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ concurrency: | |
permissions: | ||
packages: write | ||
|
||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -42,11 +44,15 @@ jobs: | |
echo "BUILD_ARCH=${build_arch//\//-}" >> ${GITHUB_ENV} | ||
echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV} | ||
# Get the repository's code | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v3 | ||
|
||
- uses: actions/setup-python@v5 | ||
|
||
- uses: pre-commit/[email protected] | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
|
@@ -71,6 +77,7 @@ jobs: | |
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
|
@@ -80,12 +87,12 @@ jobs: | |
|
||
- name: Build and push | ||
id: build-and-push | ||
uses: docker/build-push-action@v5 | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./docker/Dockerfile | ||
platforms: ${{ matrix.docker_build_arch }} | ||
no-cache: ${{ inputs.clean_build == true }} | ||
no-cache: ${{ inputs.clean_build == true || false }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
outputs: type=image,name=ghcr.io/${{ env.REPOSITORY_LC }},push-by-digest=true,name-canonical=true,push=true | ||
cache-from: type=gha | ||
|
@@ -96,6 +103,7 @@ jobs: | |
mkdir -p /tmp/digests | ||
digest="${{ steps.build-and-push.outputs.digest }}" | ||
touch "/tmp/digests/${digest#sha256:}" | ||
- name: Upload digest | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
|
@@ -104,6 +112,8 @@ jobs: | |
if-no-files-found: error | ||
retention-days: 1 | ||
|
||
|
||
|
||
merge: | ||
runs-on: ubuntu-latest | ||
needs: | ||
|
@@ -114,14 +124,17 @@ jobs: | |
REPOSITORY: '${{ github.repository }}' | ||
run: | | ||
echo "REPOSITORY_LC=${REPOSITORY,,}" >> ${GITHUB_ENV} | ||
- name: Download digests | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp/digests | ||
pattern: digests-* | ||
merge-multiple: true | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
|
@@ -137,17 +150,20 @@ jobs: | |
type=semver,pattern={{major}} | ||
type=sha | ||
images: ghcr.io/${{ env.REPOSITORY_LC }} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create manifest list and push | ||
working-directory: /tmp/digests | ||
run: | | ||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
$(printf 'ghcr.io/${{ env.REPOSITORY_LC }}@sha256:%s ' *) | ||
- name: Inspect image | ||
run: | | ||
docker buildx imagetools inspect ghcr.io/${{ env.REPOSITORY_LC }}:${{ steps.meta.outputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters