atri.dad/.github/workflows/docker.yml

43 lines
1 KiB
YAML
Raw Normal View History

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