docker build with tags

This commit is contained in:
Jan Prochazka 2022-09-28 19:02:13 +02:00
parent 9ed1cdf4b7
commit da00e1c228

View File

@ -40,19 +40,61 @@ jobs:
- name: Prepare docker image - name: Prepare docker image
run: | run: |
yarn run prepare:docker yarn run prepare:docker
- name: Build docker image
run: | - name: Docker meta
docker build ./docker -t dbgate id: meta
- name: Push docker image uses: docker/metadata-action@v4
run: | with:
docker tag dbgate dbgate/dbgate:beta images: |
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} dbgate/dbgate
docker push dbgate/dbgate:beta tags: |
- name: Build alpine docker image type=semver,pattern={{version}}
run: | type=semver,pattern={{major}}.{{minor}}
docker build ./docker -t dbgate -f docker/Dockerfile-alpine
- name: Push alpine docker image - name: Build docker
run: | uses: mr-smithers-excellent/docker-build-push@v3
docker tag dbgate dbgate/dbgate:beta-alpine with:
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} image: dbgate/dbgate
docker push dbgate/dbgate:beta-alpine registry: docker.io
dockerfile: docker/Dockerfile
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: ${{ steps.meta.outputs.tags }},beta
- name: Docker alpine meta
id: alpmeta
uses: docker/metadata-action@v4
with:
images: |
dbgate/dbgate
tags: |
type=semver,pattern={{version}},suffix=-alpine
type=semver,pattern={{major}}.{{minor}},suffix=-alpine
# - name: Build docker image
# run: |
# docker build ./docker -t dbgate
# - name: Push docker image
# run: |
# docker tag dbgate dbgate/dbgate:beta
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# docker push dbgate/dbgate:beta
# - name: Build alpine docker image
# run: |
# docker build ./docker -t dbgate -f docker/Dockerfile-alpine
# - name: Push alpine docker image
# run: |
# docker tag dbgate dbgate/dbgate:beta-alpine
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
# docker push dbgate/dbgate:beta-alpine
- name: Build docker
uses: mr-smithers-excellent/docker-build-push@v3
with:
image: dbgate/dbgate
registry: docker.io
dockerfile: docker/Dockerfile-alpine
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: ${{ steps.alpmeta.outputs.tags }},beta