All checks were successful
Deploy Docker Image / build-and-push (push) Successful in 2m16s
This reverts commit c4c1b8c59e.
51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
name: Deploy Docker Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Set Registry Domain
|
|
# Extracts the registry domain from the server URL
|
|
run: |
|
|
REGISTRY_DOMAIN=$(echo "${{ github.server_url }}" | sed 's|https://||' | sed 's|http://||')
|
|
echo "REGISTRY_DOMAIN=$REGISTRY_DOMAIN" >> $GITHUB_ENV
|
|
|
|
- name: Login to Gitea Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ env.REGISTRY_DOMAIN }}
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Make version_env.sh executable
|
|
run: chmod +x ./.gitea/workflows/version_env.sh
|
|
|
|
- name: Set version tags from Dockerfile
|
|
# Reads version from Dockerfile and sets MAJOR, MAJOR_MINOR, VERSION
|
|
run: ./.gitea/workflows/version_env.sh
|
|
|
|
- name: Build and push Docker image (multi-arch)
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: |
|
|
${{ env.REGISTRY_DOMAIN }}/${{ github.repository }}:latest
|
|
${{ env.REGISTRY_DOMAIN }}/${{ github.repository }}:${{ env.MAJOR }}
|
|
${{ env.REGISTRY_DOMAIN }}/${{ github.repository }}:${{ env.MAJOR_MINOR }}
|
|
${{ env.REGISTRY_DOMAIN }}/${{ github.repository }}:${{ env.VERSION }}
|