Skip to content

Dont generate activity RC2 #72

Dont generate activity RC2

Dont generate activity RC2 #72

Workflow file for this run

# This workflow builds the docker image on any PR or Release
# Releases will be tagged with latest, stable, and their git tag
# Prereleases will be tagged with prerelease and their git tag
# Pull Requests will be tagged with branch name and their github ref (pr-{number})
name: Create and publish a Docker image
on:
release:
types: [published]
pull_request:
branches:
- '*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
RELEASE: ${{ github.event.release != null && github.event.release.prerelease != true }}
PRERELEASE: ${{ github.event.release != null && github.event.release.prerelease == true }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Fix versions
run: python scripts/github_version_fix.py
- name: Setup docker buildx
uses: docker/setup-buildx-action@v1
id: buildx
with:
install: true
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=${{ env.RELEASE }}
tags: |
type=ref, event=tag, enable=true
type=ref, event=branch, enable=true
type=ref, event=pr, enable=true
type=raw, value=prerelease, enable=${{ env.PRERELEASE }}
type=raw, value=stable, enable=${{ env.RELEASE }}
type=raw, value=${{ github.head_ref }}, enable=${{ github.event.pull_request != null}}
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
file: docker/Dockerfile
push: ${{ github.event.release != null }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max