Compare commits
2 Commits
03f5eaf1d2
...
06c3aca483
| Author | SHA1 | Date | |
|---|---|---|---|
|
06c3aca483
|
|||
|
44937b6493
|
@@ -6,6 +6,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- alpine
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -14,26 +15,49 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
# --- Logins ---
|
# --- Logins ---
|
||||||
|
- name: Login to Gitea Registry
|
||||||
|
if: ${{ github.ref == 'refs/heads/alpine' }}
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
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
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
# ---------------- BRANCH BUILD (main) ----------------
|
# ---------------- BRANCH BUILD (main) ----------------
|
||||||
# On Branch: Gitea and Docker Hub :latest
|
# On Branch main: Docker Hub :latest
|
||||||
- name: Build & push (branch -> only :latest everywhere)
|
# On Branch alpine: Gitea :alpine
|
||||||
if: ${{ github.ref_type == 'branch' && github.ref == 'refs/heads/main' }}
|
- name: Repo owner to lowercase
|
||||||
uses: docker/build-push-action@v6
|
run: echo "REPO_OWNER_LC=$(echo '${{ gitea.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build and push main image to Docker Hub
|
||||||
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
tags: |
|
tags: |
|
||||||
${{ secrets.DOCKERHUB_USERNAME }}/borgbackup-ssh:latest
|
${{ secrets.DOCKERHUB_USERNAME }}/borgbackup-ssh:latest
|
||||||
|
|
||||||
|
- name: Build and push Alpine image to Gitea
|
||||||
|
if: ${{ github.ref == 'refs/heads/alpine' }}
|
||||||
|
uses: docker/build-push-action@v7
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
platforms: linux/amd64
|
||||||
|
tags: |
|
||||||
|
${{ vars.DOCKER_REGISTRY_URL }}/${{ env.REPO_OWNER_LC }}/borgbackup-ssh:alpine
|
||||||
|
|||||||
Reference in New Issue
Block a user