-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from serlo/push-images-to-ghcr
Use GHCR instead of Google
- Loading branch information
Showing
9 changed files
with
128 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Push dbdump image | ||
on: | ||
push: | ||
paths: | ||
- 'images/dbdump/**' | ||
|
||
jobs: | ||
docker-image: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Get version from Makefile | ||
id: get-version | ||
run: | | ||
cd images/dbdump | ||
VERSION=$(make echo-version) | ||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Check if image exists | ||
id: check-image | ||
run: | | ||
IMAGE_EXISTS=$(docker manifest inspect ghcr.io/${{ github.repository }}/dbdump:${{ steps.get-version.outputs.VERSION }} > /dev/null && echo "true" || echo "false") | ||
echo "IMAGE_EXISTS=$IMAGE_EXISTS" >> $GITHUB_OUTPUT | ||
- name: Log in to GitHub Container Registry | ||
if: steps.check-image.outputs.IMAGE_EXISTS == 'false' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push Docker image | ||
if: steps.check-image.outputs.IMAGE_EXISTS == 'false' | ||
run: | | ||
cd images/dbdump | ||
make docker_build | ||
docker tag serlo/athene2-dbdump-cronjob:${{ steps.get-version.outputs.VERSION }} ghcr.io/${{ github.repository }}/dbdump:${{ steps.get-version.outputs.VERSION }} | ||
docker push ghcr.io/${{ github.repository }}/dbdump:${{ steps.get-version.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Push dbsetup image | ||
on: | ||
push: | ||
paths: | ||
- 'images/dbsetup/**' | ||
|
||
jobs: | ||
docker-image: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Get version from Makefile | ||
id: get-version | ||
run: | | ||
cd images/dbsetup | ||
VERSION=$(make echo-version) | ||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Check if image exists | ||
id: check-image | ||
run: | | ||
IMAGE_EXISTS=$(docker manifest inspect ghcr.io/${{ github.repository }}/dbsetup:${{ steps.get-version.outputs.VERSION }} > /dev/null && echo "true" || echo "false") | ||
echo "IMAGE_EXISTS=$IMAGE_EXISTS" >> $GITHUB_OUTPUT | ||
- name: Log in to GitHub Container Registry | ||
if: steps.check-image.outputs.IMAGE_EXISTS == 'false' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push Docker image | ||
if: steps.check-image.outputs.IMAGE_EXISTS == 'false' | ||
run: | | ||
cd images/dbsetup | ||
make docker_build | ||
docker tag serlo/athene2-dbsetup-cronjob:${{ steps.get-version.outputs.VERSION }} ghcr.io/${{ github.repository }}/dbsetup:${{ steps.get-version.outputs.VERSION }} | ||
docker push ghcr.io/${{ github.repository }}/dbsetup:${{ steps.get-version.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Push mongodb-tools image | ||
on: | ||
push: | ||
paths: | ||
- 'images/mongodb-tools/**' | ||
|
||
jobs: | ||
docker-image: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Get version from Makefile | ||
id: get-version | ||
run: | | ||
cd images/mongodb-tools | ||
VERSION=$(make echo-version) | ||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | ||
- name: Check if image exists | ||
id: check-image | ||
run: | | ||
IMAGE_EXISTS=$(docker manifest inspect ghcr.io/${{ github.repository }}/mongodb-tools:${{ steps.get-version.outputs.VERSION }} > /dev/null && echo "true" || echo "false") | ||
echo "IMAGE_EXISTS=$IMAGE_EXISTS" >> $GITHUB_OUTPUT | ||
- name: Log in to GitHub Container Registry | ||
if: steps.check-image.outputs.IMAGE_EXISTS == 'false' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push Docker image | ||
if: steps.check-image.outputs.IMAGE_EXISTS == 'false' | ||
run: | | ||
cd images/mongodb-tools | ||
make docker_build | ||
docker tag serlo/mongodb-tools-base:${{ steps.get-version.outputs.VERSION }} ghcr.io/${{ github.repository }}/mongodb-tools:${{ steps.get-version.outputs.VERSION }} | ||
docker push ghcr.io/${{ github.repository }}/mongodb-tools:${{ steps.get-version.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
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
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
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
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
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