Skip to content

pep723

pep723 #13

Workflow file for this run

name: Docker Image CI
on:
push:
branches:
- develop
tags:
- v*.*.*
pull_request:
branches:
- '*'
permissions: { }
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
permissions:
contents: read # to fetch code (actions/checkout)
packages: write # to push to ghcr.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup QEMU
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3
with:
install: true
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
if: github.event_name == 'push'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5
with:
images: |
flexget/flexget
ghcr.io/${{ github.repository_owner }}/flexget
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=branch
- name: Build Base Docker Image
id: docker_build
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6
with:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.output.name }}
push: ${{ github.event_name == 'push' && github.ref != 'refs/heads/master' }}
platforms: linux/amd64,linux/arm64
provenance: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=gha, scope=${{ github.ref_name }}
type=gha, scope=${{ github.base_ref }}
cache-to: type=gha, mode=max, scope=${{ github.ref_name }}