Skip to content

feat: ensure pip is up to date and config file is loaded before downl… #14

feat: ensure pip is up to date and config file is loaded before downl…

feat: ensure pip is up to date and config file is loaded before downl… #14

Workflow file for this run

name: Publish Docker Image
on:
push:
branches:
- 'main'
paths:
- 'templates/**'
- '**.py'
- 'Dockerfile'
- 'requirements.txt'
tags:
- 'v*'
pull_request:
branches:
- 'main'
paths:
- 'templates/**'
- '**.py'
- 'Dockerfile'
- 'requirements.txt'
types:
- closed
jobs:
docker:
name: Build Docker image and push to Docker Hub and GHCR
if: ${{ (github.event_name == 'push' && 'pass' || (github.event.pull_request.merged == true && 'pass' || 'fail')) == 'pass' }}
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ github.repository }}
ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max