Small improvements #160
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish Docker Images | |
on: | |
release: | |
types: [published] | |
push: | |
branches: | |
- develop | |
# Only build the image when a file in the image is updated | |
# These paths are files in the git repository from | |
# .dockerignore (except the Docker files) | |
paths-ignore: | |
- ".devcontainer/**" | |
- ".editorconfig" | |
- ".github/**" | |
- "!.github/workflows/docker.yml" # Still run on changes to this file | |
- ".gitignore" | |
- ".pre-commit-config.yaml" | |
- "**.md" | |
- "config.example.json" | |
- "config.schema.json" | |
- "LICENSE" | |
- "pyproject.toml" | |
- "setup.cfg" | |
- "tests/**" | |
jobs: | |
build-and-push-images: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- 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_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
# A new tagged release is published, which builds :tag and :latest | |
- name: Build and push :tag | |
if: github.event_name == 'release' | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ secrets.DOCKER_HUB_USERNAME }}/auto-southwest-check-in:${{ github.event.release.tag_name }} | |
${{ secrets.DOCKER_HUB_USERNAME }}/auto-southwest-check-in:latest | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
# Don't use the cache for release images to ensure everything is up to date | |
# Develop branch push, which builds :develop | |
- name: Build and push :develop | |
if: github.event_name == 'push' | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ secrets.DOCKER_HUB_USERNAME }}/auto-southwest-check-in:develop | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |