Merge pull request #13 from serlo/patch #15
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
name: Docker | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update-version: | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.version.outputs.tag }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
- id: version | |
uses: salsify/action-detect-and-tag-new-version@v2 | |
with: | |
tag-template: '{VERSION}' | |
version-command: | | |
cat VERSION | |
push: | |
runs-on: ubuntu-latest | |
needs: update-version | |
if: ${{ needs.update-version.outputs.tag }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: '${{ secrets.GCP_KEY_CONTAINER_REGISTRY }}' | |
- uses: google-github-actions/setup-gcloud@v1 | |
- run: gcloud auth configure-docker | |
- uses: docker/build-push-action@v4 | |
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 }} | |
- 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 |