Skip to content

Commit

Permalink
Merge pull request #45 from serlo/push-images-to-ghcr
Browse files Browse the repository at this point in the history
push image to GHCR instead of Google
  • Loading branch information
hugotiburtino authored Jul 30, 2024
2 parents 2cfd91f + d40ea39 commit 4d61971
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/docker-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
credentials_json: '${{ secrets.GCP_KEY_CONTAINER_REGISTRY }}'
- uses: google-github-actions/setup-gcloud@v2
- run: gcloud auth configure-docker
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
push: true
file: ./Dockerfile
tags: eu.gcr.io/serlo-shared/serlo-mysql-database:${{ github.ref_name }}
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
- name: Test for mysql in the serlo-mysql-database image
run:
docker run --entrypoint='' --rm eu.gcr.io/serlo-shared/serlo-mysql-database:${{ github.ref_name }} mysql --version
docker run --entrypoint='' --rm ghcr.io/${{ github.repository }}:${{ github.ref_name }} mysql --version
13 changes: 7 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@ jobs:
if: ${{ needs.update-version.outputs.tag }}
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
credentials_json: '${{ secrets.GCP_KEY_CONTAINER_REGISTRY }}'
- uses: google-github-actions/setup-gcloud@v2
- run: gcloud auth configure-docker
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
push: true
file: ./Dockerfile
tags: eu.gcr.io/serlo-shared/serlo-mysql-database:latest,eu.gcr.io/serlo-shared/serlo-mysql-database:${{ needs.update-version.outputs.tag }}
tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}/serlo-mysql-database:${{ needs.update-version.outputs.tag }}
- name: Test for mysql in the serlo-mysql-database image
run:
docker run --entrypoint='' --rm eu.gcr.io/serlo-shared/serlo-mysql-database:latest mysql --version
docker run --entrypoint='' --rm ghcr.io/${{ github.repository }}:latest mysql --version

0 comments on commit 4d61971

Please sign in to comment.