diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml deleted file mode 100644 index 61f8f57..0000000 --- a/.gitea/workflows/build.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: release-tag -on: - schedule: - - cron: "@weekly" - push: - branches: - - "main" - - "master" - -jobs: - release-image: - runs-on: ubuntu-latest - container: - image: catthehacker/ubuntu:act-latest - env: - DOCKER_ORG: chris - DOCKER_LATEST: latest - RUNNER_TOOL_CACHE: /toolcache - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v2 - with: # replace it with your local IP - config-inline: | - [registry."git.debilux.org"] - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - registry: git.debilux.org # replace it with your local IP - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Get Meta - id: meta - run: | - echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT - echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile - platforms: | - linux/amd64 - linux/arm64 - push: true - tags: | # replace it with your local IP and tags - git.debilux.org/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }} - git.debilux.org/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }} diff --git a/.gitea/workflows/docker-build-multiarch.yml b/.gitea/workflows/docker-build-multiarch.yml new file mode 100644 index 0000000..a3ed460 --- /dev/null +++ b/.gitea/workflows/docker-build-multiarch.yml @@ -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 diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml new file mode 100644 index 0000000..583314c --- /dev/null +++ b/.gitea/workflows/docker-build.yml @@ -0,0 +1,58 @@ +name: Build and Push 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 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 + push: ${{ github.event_name != 'pull_request' }} + 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