Skip to content

Docker

Docker #328

name: Docker
permissions:
contents: write
on:
schedule:
- cron: '0 0 * * MON'
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log into Docker Hub registry
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log into GHCR registry
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
with:
images: |
ghcr.io/skaronator/zrepl
skaronator/zrepl
labels: |
org.opencontainers.image.title=zrepl
org.opencontainers.image.description=One-stop ZFS backup & replication solution
org.opencontainers.image.vendor=Skaronator
- name: Build and push Docker image
id: build-and-push
uses: docker/[email protected]
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- uses: gautamkrishnar/keepalive-workflow@v2