Docker #351
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/login-action@v3.3.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Log into GHCR registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5.6.1 | |
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/build-push-action@v6.12.0 | |
with: | |
context: . | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- uses: gautamkrishnar/keepalive-workflow@v2 |