Skip to content

Merge pull request #425 from mboudet/dev #22

Merge pull request #425 from mboudet/dev

Merge pull request #425 from mboudet/dev #22

name: Publish Flaskomics Docker image to github
on:
push:
branches:
- 'master'
- 'dev'
tags:
- '*.*.*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: flaskomics
jobs:
build-and-push-image:
if: github.repository == 'askomics/flaskomics'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
-
name: Checkout repository
uses: actions/checkout@v3
-
name: Login to registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: ${{ env.REGISTRY }}/askomics/${{ env.IMAGE_NAME }}
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}