Push image to ghcr.io #16
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: Push image to ghcr.io | |
on: | |
push: | |
tags: ["v*"] | |
workflow_dispatch: | |
permissions: | |
packages: write | |
contents: read # This is required for actions/checkout | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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: Clean up | |
run: docker system prune --force | |
- name: Build and push amd64 image | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64 | |
push: true | |
tags: ghcr.io/${{ github.actor }}/zephyr-ready:${{ github.event_name == 'workflow_dispatch' && 'latest' || github.ref_name }} | |
- name: Clean up again | |
run: docker system prune --force | |
- name: Build and push arm64 image | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/arm64 | |
push: true | |
tags: ghcr.io/${{ github.actor }}/zephyr-ready:${{ github.event_name == 'workflow_dispatch' && 'latest' || github.ref_name }} |