Skip to content

init

init #1

name: Build and Publish Docker image on release
# Uncomment to use
#on:
# release:
# types: [published]
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check Out Repository
uses: actions/checkout@v2
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/python-app:latest
ghcr.io/${{ github.repository_owner }}/python-app:${{ github.event.release.tag_name }}
cache-from: type=gha
cache-to: type=gha,mode=max