Skip to content

Release Container Image #1483

Release Container Image

Release Container Image #1483

name: Release Container Image
on:
schedule:
- cron: '3 3 * * *'
pull_request:
push:
branches: main
tags:
- 'v*.*.*'
jobs:
container:
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: Configure Image Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
docker.io/adfinissygroup/openshift-etcd-backup
ghcr.io/adfinis/openshift-etcd-backup
quay.io/adfinis/openshift-etcd-backup
tags: |
type=schedule,pattern=nightly
type=edge
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}
type=semver,pattern=v{{major}}.{{minor}}
type=ref,event=pr
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name != 'pull_request' }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
if: ${{ github.event_name != 'pull_request' }}
- name: Login to quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME}}
password: ${{ secrets.QUAY_ACCESS_TOKEN }}
if: ${{ github.event_name != 'pull_request' }}
- name: Build and push
id: docker_build_ghcr
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}