Skip to content

EW-965 Patch 2 (#17) #65

EW-965 Patch 2 (#17)

EW-965 Patch 2 (#17) #65

Workflow file for this run

name: Publish Docker Image
on:
push:
tags:
- "[0-9]*"
jobs:
publish_docker_image:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Docker meta service name for GitHub development image
id: docker_meta_img_dev
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/dev
tags: |
type=raw,value=latest,enable=${{ github.event.repository.default_branch == 'main' }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Docker meta service name for DockerHub production image
id: docker_meta_img_prod
uses: docker/metadata-action@v5
with:
images: schulcloud/erwin-idm
tags: |
type=raw,value=latest,enable=${{ github.event.repository.default_branch == 'main' }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Log into GitHub registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log into DockerHub registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push ${{ github.repository }} development image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
target: development
tags: ${{ steps.docker_meta_img_dev.outputs.tags }}
labels: ${{ steps.docker_meta_img_dev.outputs.labels }}
- name: Build and push ${{ github.repository }} production image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
target: production
tags: ${{ steps.docker_meta_img_prod.outputs.tags }}
labels: ${{ steps.docker_meta_img_prod.outputs.labels }}