84 lines
2.7 KiB
YAML
84 lines
2.7 KiB
YAML
name: Build and Release Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build_amd64:
|
|
name: Build and Push amd64
|
|
runs-on: [ubuntu-latest, linux_amd64]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.t000-n.de
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Build Docker image for amd64
|
|
run: |
|
|
docker build \
|
|
--platform linux/amd64 \
|
|
-f Dockerfile \
|
|
-t gitea.t000-n.de/t.behrendt/backupsidecar:${{ github.sha }}-amd64 \
|
|
.
|
|
|
|
- name: Push Docker image for amd64
|
|
run: |
|
|
docker push gitea.t000-n.de/t.behrendt/backupsidecar:${{ github.sha }}-amd64
|
|
|
|
build_arm64:
|
|
name: Build and Push arm64
|
|
runs-on: [ubuntu-latest, linux_arm64]
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.t000-n.de
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Build Docker image for arm64
|
|
run: |
|
|
docker build \
|
|
--platform linux/arm64 \
|
|
-f Dockerfile \
|
|
-t gitea.t000-n.de/t.behrendt/backupsidecar:${{ github.sha }}-arm64 \
|
|
.
|
|
|
|
- name: Push Docker image for arm64
|
|
run: |
|
|
docker push gitea.t000-n.de/t.behrendt/backupsidecar:${{ github.sha }}-arm64
|
|
|
|
manifest:
|
|
name: Create and Push Multi-Arch Manifest
|
|
needs: [build_amd64, build_arm64]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Log in to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.t000-n.de
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Create and push manifest with git SHA
|
|
run: |
|
|
docker manifest create gitea.t000-n.de/t.behrendt/backupsidecar:${{ github.sha }} \
|
|
gitea.t000-n.de/t.behrendt/backupsidecar:${{ github.sha }}-amd64 \
|
|
gitea.t000-n.de/t.behrendt/backupsidecar:${{ github.sha }}-arm64
|
|
docker manifest push gitea.t000-n.de/t.behrendt/backupsidecar:${{ github.sha }}
|
|
|
|
docker manifest create gitea.t000-n.de/t.behrendt/backupsidecar:latest \
|
|
gitea.t000-n.de/t.behrendt/backupsidecar:${{ github.sha }}-amd64 \
|
|
gitea.t000-n.de/t.behrendt/backupsidecar:${{ github.sha }}-arm64
|
|
docker manifest push gitea.t000-n.de/t.behrendt/backupsidecar:latest
|