Skip to content

feat: use ghcr image instead of docker #533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,49 @@ jobs:
username: ewjoachim
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.6.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.10.0

- name: Login to GitHub Container Registry
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ github.actor }}
password: ${{ github.token }}

- id: docker_meta
uses: docker/metadata-action@v5.7.0
with:
images: ghcr.io/${{ github.repository }}
tags: type=sha,format=long

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
# See Dockerfile.build for instructions on bumping this.
context: .
file: Dockerfile.build
platforms: linux/amd64,linux/arm64
labels: |
project='python-coverage-comment-action-base'
org='py-cov-action'
commit-sha='${{ github.sha }}'
org.opencontainers.image.source='https://github.com/${{ github.repository }}'
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'
org.opencontainers.image.licenses='MIT'
tags: |
ewjoachim/python-coverage-comment-action-base:v6
ghcr.io/py-cov-action/python-coverage-comment-action-base:v6
${{ steps.docker_meta.outputs.tags }}
ghcr.io/${{ github.repository }}:${{ github.sha }}
ghcr.io/${{ github.repository }}:latest
cache-from: |
ghcr.io/${{ github.repository }}:${{ github.sha }}
ghcr.io/${{ github.repository }}:latest
cache-to: type=inline
push: true
file: Dockerfile.build
platforms: linux/amd64,linux/arm64

compute-tags:
name: Re-tag action with new version
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See Dockerfile.build for instructions on bumping this.
FROM ewjoachim/python-coverage-comment-action-base:v6
FROM ghcr.io/py-cov-action/python-coverage-comment-action-base:v6

COPY coverage_comment ./coverage_comment
RUN md5sum -c pyproject.toml.md5 || pip install -e .
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -614,3 +614,10 @@ with badges. We've been iterating a lot on the new format.
It's perfectly ok if you preferred the old format. In that case, see
#335 for instructions on how to emulate the old format using
`COMMENT_TEMPLATE`.

## New base image registry

The Dockerfile used by this image can have both registeries as sources:
- ewjoachim/python-coverage-comment-action-base:v6
- ghcr.io/py-cov-action/python-coverage-comment-action-base:v6
Take your pick according to your needs.
Comment on lines +620 to +623
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear how users could change something there, I believe the choice we make is something everyone has to live with, no ?

Also, better not hardcode v6 in too many places !

Loading