Skip to content

fix: CI workflow tokens issue #39

fix: CI workflow tokens issue

fix: CI workflow tokens issue #39

name: Build and Push Docker Image
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
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: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/pingoleon/notifynotes:latest
ghcr.io/pingoleon/notifynotes:amd64
ghcr.io/pingoleon/notifynotes:arm64
cache-from: type=gha
cache-to: type=gha,mode=max