-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (39 loc) · 1.22 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Docker
on:
push:
branches:
- main
jobs:
update-version:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.version.outputs.tag }}
steps:
- uses: actions/checkout@v4
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@v4
- uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_KEY_CONTAINER_REGISTRY }}'
- uses: google-github-actions/setup-gcloud@v2
- run: gcloud auth configure-docker
- uses: docker/build-push-action@v5
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