Skip to content

Commit 4f8a42a

Browse files
ci: bump actions/download-artifact from v3 to v4 in /.github/workflows (#103)
* chore(deps): bump actions/download-artifact in /.github/workflows Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.1.7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v3...v4.1.7) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * ci: fix artifact actions --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: yyoung <[email protected]>
1 parent 487a4f1 commit 4f8a42a

File tree

2 files changed

+66
-63
lines changed

2 files changed

+66
-63
lines changed

.github/workflows/docker-image.yaml

+64-61
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1+
# https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
12
name: Build and publish Docker image
23

34
on:
45
workflow_dispatch:
6+
inputs:
7+
tag:
8+
description: Tag of the image
9+
required: true
10+
type: string
511
release:
612
types: [published]
713

814
env:
915
USERNAME: yyoung01
10-
REGISTRY_IMAGE: yyoung01/nazurin
16+
DOCKERHUB_REPO: yyoung01/nazurin
17+
GHCR_REPO: ghcr.io/${{ github.repository }}
1118

1219
jobs:
1320
build:
@@ -22,104 +29,100 @@ jobs:
2229
- linux/amd64
2330
- linux/arm64
2431
steps:
25-
-
26-
name: Checkout
32+
- name: Prepare
33+
run: |
34+
platform=${{ matrix.platform }}
35+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
36+
- name: Checkout
2737
uses: actions/checkout@v3
28-
-
29-
name: Docker meta
38+
- name: Docker meta
3039
id: meta
31-
uses: docker/metadata-action@v4
40+
uses: docker/metadata-action@v5
3241
with:
3342
images: |
34-
${{ env.REGISTRY_IMAGE }}
35-
ghcr.io/${{ github.repository }}
36-
-
37-
name: Set up QEMU
38-
uses: docker/setup-qemu-action@v2
39-
-
40-
name: Set up Docker Buildx
41-
uses: docker/setup-buildx-action@v2
42-
-
43-
name: Login to Docker Hub
44-
uses: docker/login-action@v2
43+
${{ env.DOCKERHUB_REPO }}
44+
${{ env.GHCR_REPO }}
45+
- name: Set up QEMU
46+
uses: docker/setup-qemu-action@v3
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v3
49+
- name: Login to Docker Hub
50+
uses: docker/login-action@v3
4551
with:
4652
username: ${{ env.USERNAME }}
4753
password: ${{ secrets.DOCKER_PASSWORD }}
48-
-
49-
name: Log in to the Container registry
50-
uses: docker/login-action@v2
54+
- name: Log in to the Container registry
55+
uses: docker/login-action@v3
5156
with:
5257
registry: ghcr.io
5358
username: ${{ github.actor }}
5459
password: ${{ secrets.GITHUB_TOKEN }}
55-
-
56-
name: Build and push by digest
60+
- name: Build and push by digest
5761
id: build
58-
uses: docker/build-push-action@v4
62+
uses: docker/build-push-action@v6
5963
with:
60-
context: .
64+
# Result in an empty layer in GHCR if set to true
6165
provenance: false
6266
platforms: ${{ matrix.platform }}
6367
labels: ${{ steps.meta.outputs.labels }}
64-
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
68+
outputs: type=image,"name=${{ env.DOCKERHUB_REPO }},${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=true
6569
file: ${{ (matrix.platform == 'linux/amd64') && 'Dockerfile' || 'Dockerfile.debian' }}
66-
-
67-
name: Export digest
70+
- name: Export digest
6871
run: |
69-
mkdir -p /tmp/digests
72+
mkdir -p ${{ runner.temp }}/digests
7073
digest="${{ steps.build.outputs.digest }}"
71-
touch "/tmp/digests/${digest#sha256:}"
72-
-
73-
name: Upload digest
74-
uses: actions/upload-artifact@v3
74+
touch "${{ runner.temp }}/digests/${digest#sha256:}"
75+
- name: Upload digest
76+
uses: actions/upload-artifact@v4
7577
with:
76-
name: digests
77-
path: /tmp/digests/*
78+
name: digests-${{ env.PLATFORM_PAIR }}
79+
path: ${{ runner.temp }}/digests/*
7880
if-no-files-found: error
7981
retention-days: 1
80-
82+
8183
merge:
8284
runs-on: ubuntu-latest
8385
needs:
8486
- build
8587
steps:
86-
-
87-
name: Download digests
88-
uses: actions/download-artifact@v3
88+
- name: Download digests
89+
uses: actions/download-artifact@v4
8990
with:
90-
name: digests
91-
path: /tmp/digests
92-
-
93-
name: Set up Docker Buildx
94-
uses: docker/setup-buildx-action@v2
95-
-
96-
name: Docker meta
91+
path: ${{ runner.temp }}/digests
92+
pattern: digests-*
93+
merge-multiple: true
94+
- name: Set up Docker Buildx
95+
uses: docker/setup-buildx-action@v3
96+
- name: Docker meta
9797
id: meta
98-
uses: docker/metadata-action@v4
98+
uses: docker/metadata-action@v5
9999
with:
100100
images: |
101-
${{ env.REGISTRY_IMAGE }}
102-
ghcr.io/${{ github.repository }}
103-
-
104-
name: Login to Docker Hub
105-
uses: docker/login-action@v2
101+
${{ env.DOCKERHUB_REPO }}
102+
${{ env.GHCR_REPO }}
103+
tags: |
104+
type=semver,pattern={{raw}}
105+
type=raw,value=${{ inputs.tag }},enable=${{ github.event_name == 'workflow_dispatch' }}
106+
type=raw,value=latest,enable={{is_default_branch}}
107+
- name: Login to Docker Hub
108+
uses: docker/login-action@v3
106109
with:
107110
username: ${{ env.USERNAME }}
108111
password: ${{ secrets.DOCKER_PASSWORD }}
109-
-
110-
name: Log in to the Container registry
111-
uses: docker/login-action@v2
112+
- name: Log in to the Container registry
113+
uses: docker/login-action@v3
112114
with:
113115
registry: ghcr.io
114116
username: ${{ github.actor }}
115117
password: ${{ secrets.GITHUB_TOKEN }}
116-
-
117-
name: Create manifest list and push
118-
working-directory: /tmp/digests
118+
- name: Create manifest list and push
119+
working-directory: ${{ runner.temp }}/digests
119120
run: |
120121
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
121-
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
122-
-
123-
name: Inspect image
122+
$(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *)
123+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
124+
$(printf '${{ env.GHCR_REPO }}@sha256:%s ' *)
125+
- name: Inspect image
124126
run: |
125-
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
127+
docker buildx imagetools inspect ${{ env.DOCKERHUB_REPO }}:${{ steps.meta.outputs.version }}
128+
docker buildx imagetools inspect ${{ env.GHCR_REPO }}:${{ steps.meta.outputs.version }}

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
ARG PYTHON_VERSION=3.8
22

33
ARG CURL_IMPERSONATE_VERSION=0.5-chrome
4-
FROM lwthiker/curl-impersonate:${CURL_IMPERSONATE_VERSION} as curl
4+
FROM lwthiker/curl-impersonate:${CURL_IMPERSONATE_VERSION} AS curl
55

66
# Builder
7-
FROM python:${PYTHON_VERSION}-alpine as builder
7+
FROM python:${PYTHON_VERSION}-alpine AS builder
88

99
RUN apk add --update git build-base libffi-dev curl-dev
1010

0 commit comments

Comments
 (0)