pollo/.github/workflows/docker.yml

43 lines
1 KiB
YAML
Raw Normal View History

2024-09-20 23:10:42 -06:00
name: Build and Push Multi-Arch Docker Image
2024-09-20 01:52:24 -06:00
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-push:
runs-on: ubuntu-latest
2024-09-20 23:10:42 -06:00
permissions:
contents: read
packages: write
2024-09-20 01:52:24 -06:00
2024-09-20 23:10:42 -06:00
steps:
- name: Checkout code
uses: actions/checkout@v3
2024-09-20 01:52:24 -06:00
2024-09-20 23:10:42 -06:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
2024-09-20 01:52:24 -06:00
2024-09-20 23:10:42 -06:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
2024-09-20 01:52:24 -06:00
2024-09-20 23:10:42 -06:00
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest