add docker image build

This commit is contained in:
2025-10-21 09:07:12 +02:00
parent 6c6ec1f1c4
commit 3aacd311ce
+21 -17
View File
@@ -1,4 +1,5 @@
name: Build and Push Docker Container name: Build and Push Docker Container
on: on:
schedule: schedule:
- cron: "0 11 * * 5" - cron: "0 11 * * 5"
@@ -18,29 +19,32 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
# --- Logins ---
- name: Login to Gitea Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.ACTION_ACCESS_TOKEN }}
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
username: ${{ secrets.DOCKER_HUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
# Change to Brache archlinux - name: Repo owner to lowercase (for Gitea namespace)
- uses: actions/checkout@v4 run: echo "REPO_OWNER_LC=$(echo '${{ gitea.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
with:
ref: archlinux
- name: Build and push Docker image for latest tag # ---------------- BRANCH BUILD (main) ----------------
uses: docker/build-push-action@v5 # On Branch: Gitea and Docker Hub :latest
- name: Build & push (branch -> only :latest everywhere)
if: ${{ github.ref_type == 'branch' && github.ref == 'refs/heads/main' }}
uses: docker/build-push-action@v6
with: with:
context: . context: .
push: true push: true
tags: daniel156161/borgbackup-ssh:latest
platforms: linux/amd64
- name: Build and push Docker image for archlinux tag
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: daniel156161/borgbackup-ssh:archlinux
platforms: linux/amd64 platforms: linux/amd64
tags: |
${{ vars.DOCKER_REGISTRY_URL }}/${{ env.REPO_OWNER_LC }}/borgbackup-ssh:latest
${{ secrets.DOCKERHUB_USERNAME }}/borgbackup-ssh:latest