Skip to content

Create and publish a Docker image #233

Create and publish a Docker image

Create and publish a Docker image #233

Workflow file for this run

---
name: Create and publish a Docker image
on:
push:
branches: ["main"]
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Build and push
run: docker buildx build --platform linux/amd64,linux/arm64 . -t ghcr.io/bkram/pynadtuner --push