Skip to content

Commit 95add54

Browse files
authored
Merge pull request #540 from py-cov-action/ghcrio
2 parents 44cd1af + 79c7075 commit 95add54

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,49 @@ jobs:
3030
username: ewjoachim
3131
password: ${{ secrets.DOCKER_PASSWORD }}
3232

33-
- name: Log in to GitHub Container Registry
34-
uses: docker/login-action@v3
33+
- name: Set up QEMU
34+
uses: docker/setup-qemu-action@v3.6.0
35+
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v3.10.0
38+
39+
- name: Login to GitHub Container Registry
40+
uses: docker/login-action@v3.3.0
3541
with:
3642
registry: ghcr.io
37-
username: ${{ github.repository_owner }}
38-
password: ${{ secrets.GITHUB_TOKEN }}
43+
username: ${{ github.actor }}
44+
password: ${{ github.token }}
45+
46+
- id: docker_meta
47+
uses: docker/metadata-action@v5.7.0
48+
with:
49+
images: ghcr.io/${{ github.repository }}
50+
tags: type=sha,format=long
3951

4052
- name: Build and push Docker image
4153
uses: docker/build-push-action@v6
4254
with:
43-
# See Dockerfile.build for instructions on bumping this.
55+
context: .
56+
file: Dockerfile.build
57+
platforms: linux/amd64,linux/arm64
58+
labels: |
59+
project='python-coverage-comment-action-base'
60+
org='py-cov-action'
61+
commit-sha='${{ github.sha }}'
62+
org.opencontainers.image.source='https://github.com/${{ github.repository }}'
63+
org.opencontainers.image.description='Publish coverage report as PR comment, and create a coverage badge & dashboard to display on the Readme for Python projects, all inside GitHub without third party servers'
64+
org.opencontainers.image.licenses='MIT'
4465
tags: |
4566
ewjoachim/python-coverage-comment-action-base:v6
4667
ghcr.io/py-cov-action/python-coverage-comment-action-base:v6
68+
${{ steps.docker_meta.outputs.tags }}
69+
ghcr.io/${{ github.repository }}:${{ github.sha }}
70+
ghcr.io/${{ github.repository }}:latest
71+
cache-from: |
72+
ghcr.io/${{ github.repository }}:${{ github.sha }}
73+
ghcr.io/${{ github.repository }}:latest
74+
cache-to: type=inline
4775
push: true
48-
file: Dockerfile.build
49-
platforms: linux/amd64,linux/arm64
5076

5177
compute-tags:
5278
name: Re-tag action with new version

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# See Dockerfile.build for instructions on bumping this.
2-
FROM ewjoachim/python-coverage-comment-action-base:v6
2+
FROM ghcr.io/py-cov-action/python-coverage-comment-action-base:v6
33

44
COPY coverage_comment ./coverage_comment
55
RUN md5sum -c pyproject.toml.md5 || pip install -e .

0 commit comments

Comments
 (0)