Skip to content

Update GHCR workflow to provide a separate macOS release #18

Update GHCR workflow to provide a separate macOS release

Update GHCR workflow to provide a separate macOS release #18

name: Build and Publish Docker Images
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image for Linux (amd64)
run: |
docker build -t ghcr.io/${{ github.repository_owner }}/fast-music-remover:latest .
- name: Push Docker Image for Linux (amd64)
if: github.event_name == 'push'
run: |
docker push ghcr.io/${{ github.repository_owner }}/fast-music-remover:latest
- name: Build Docker Image for macOS (amd64 workaround)
run: |
docker build --platform linux/amd64 -t ghcr.io/${{ github.repository_owner }}/fast-music-remover:macos-latest .
- name: Push Docker Image for macOS (amd64 workaround)
if: github.event_name == 'push'
run: |
docker push ghcr.io/${{ github.repository_owner }}/fast-music-remover:macos-latest