Skip to content

Publish Docker image #28

Publish Docker image

Publish Docker image #28

name: Publish Docker image
on:
workflow_run:
workflows:
- Release Charts
types:
- completed
jobs:
push_to_registry:
if: github.repository == 'GESIS-Methods-Hub/andrew-django-admin'
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
-
name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Get lastest tag
id: tag_info
run: |
git describe --abbrev=0 --tags | sed -e 's/andrew-django-admin-//g' -e 's/^/VERSION=/g' >> "$GITHUB_OUTPUT"
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
target: prod
tags: |
gesiscss/andrew-django-admin:latest
gesiscss/andrew-django-admin:${{ steps.tag_info.outputs.VERSION }}