From 4f0a4cb9ea86839b0186431794d386fd72356958 Mon Sep 17 00:00:00 2001 From: crocodilestick <105450872+crocodilestick@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:11:01 +0000 Subject: [PATCH] Added automatic image build & pushing on commits involving key files to the dev tag. Also cleaned up other GitHub Action workflows --- .github/workflows/discord-release-bot.yml | 5 +- .../dockerhub-build-push-on-push.yml | 46 +++++++++++++++++++ .github/workflows/dockerhub-description.yml | 2 + 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dockerhub-build-push-on-push.yml diff --git a/.github/workflows/discord-release-bot.yml b/.github/workflows/discord-release-bot.yml index 64f27d2..7f1d005 100644 --- a/.github/workflows/discord-release-bot.yml +++ b/.github/workflows/discord-release-bot.yml @@ -1,3 +1,6 @@ +name: Post New Release Notes to Discord +# Automatically posts new Release Notes to the project's discord + on: release: types: @@ -14,4 +17,4 @@ jobs: with: webhook_url: ${{ secrets.DISCORD_RELEASE_WEBHOOK_URL }} username: "CWA Release Changelog Bot" - avatar_url: "https://ibb.co/r0yFvZx" + avatar_url: "https://github.com/crocodilestick/Calibre-Web-Automated/blob/main/README_images/cwa-logo-round-light.png" diff --git a/.github/workflows/dockerhub-build-push-on-push.yml b/.github/workflows/dockerhub-build-push-on-push.yml new file mode 100644 index 0000000..228fcc3 --- /dev/null +++ b/.github/workflows/dockerhub-build-push-on-push.yml @@ -0,0 +1,46 @@ +name: Build and Push Image to DockerHub +# Automatically builds and pushes a multi-platform dev image based on commits involving key files + +on: + push: + paths: + - 'empty_library/**' + - 'root/**' + - 'scripts/**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: DockerHub Login + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PA_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + push: true + build-args: | + BUILD_DATE=${{ github.event.repository.updated_at }} + VERSION=${{ vars.CURRENT_DEV_VERSION }}-DEV_BUILD-${{ vars.CURRENT_DEV_BUILD_NUM }} + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/calibre-web-automated:dev + + platforms: linux/amd64,linux/arm64 + + - name: Increment dev build number + uses: action-pack/increment@v2 + id: increment + with: + name: 'CURRENT_DEV_BUILD_NUM' + token: ${{ secrets.DEV_BUILD_NUM_INCREMENTOR_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/dockerhub-description.yml b/.github/workflows/dockerhub-description.yml index 121da69..6b02a54 100644 --- a/.github/workflows/dockerhub-description.yml +++ b/.github/workflows/dockerhub-description.yml @@ -1,4 +1,6 @@ name: Update Docker Hub Description +# Automatically mirrors the README to the project's DockerHub page + on: push: branches: