Updated workflows
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 4m9s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 4m9s
This commit is contained in:
60
.gitea/workflows/docker-build-multiarch.yml
Normal file
60
.gitea/workflows/docker-build-multiarch.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Build and Push Multiarch Docker Image
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# push:
|
||||
# branches: [main]
|
||||
# paths-ignore:
|
||||
# - README.md
|
||||
# - CHANGELOG.md
|
||||
# - LICENSE.md
|
||||
# pull_request:
|
||||
# branches: [main]
|
||||
# schedule:
|
||||
# - cron: '@weekly'
|
||||
|
||||
env:
|
||||
DOCKERFILE: ./Dockerfile
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ secrets.REGISTRY_URL }}
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ secrets.REGISTRY_URL }}/${{ github.repository }}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=sha,prefix={{branch}}-
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=schedule,pattern={{date 'YYYYMMDD'}}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ${{ env.DOCKERFILE }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ github.repository }}:buildcache
|
||||
cache-to: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ github.repository }}:buildcache,mode=max
|
||||
Reference in New Issue
Block a user