build step
All checks were successful
All checks were successful
This commit is contained in:
86
.gitea/workflows/cd.yaml
Normal file
86
.gitea/workflows/cd.yaml
Normal file
@@ -0,0 +1,86 @@
|
||||
name: Build and Release Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v2
|
||||
|
||||
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 }}
|
||||
|
||||
- name: Optionally tag manifest as latest
|
||||
if: ${{ inputs.latest == true }}
|
||||
run: |
|
||||
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
|
||||
Reference in New Issue
Block a user