From 0dfc2f4d60e934fc9e7773a2a71dd9b7dc2e9563 Mon Sep 17 00:00:00 2001 From: MattyTheHacker <18513864+MattyTheHacker@users.noreply.github.com> Date: Wed, 24 Jul 2024 23:17:47 +0100 Subject: [PATCH 1/6] Add workflow to push dev images --- .github/workflows/update-dev-image.yaml | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/update-dev-image.yaml diff --git a/.github/workflows/update-dev-image.yaml b/.github/workflows/update-dev-image.yaml new file mode 100644 index 00000000..40669b3e --- /dev/null +++ b/.github/workflows/update-dev-image.yaml @@ -0,0 +1,30 @@ +name: Build Dev Container Image & Push To GitHub Container Registry + +on: + pull_request: + branches: [ "main" ] + +jobs: + build-and-push-container-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' + + steps: + - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/build-push-action@v5 + with: + push: true + tags: ghcr.io/cssuob/tex-bot-py-v2:${{ github.ref_name }} + cache-from: type=gha + cache-to: type=gha,mode=max From 6daec64a59595850d30cbb5ebc6f40137f746dea Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Thu, 25 Jul 2024 00:06:21 +0100 Subject: [PATCH 2/6] Update update-dev-image.yaml --- .github/workflows/update-dev-image.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-dev-image.yaml b/.github/workflows/update-dev-image.yaml index 40669b3e..2d497d94 100644 --- a/.github/workflows/update-dev-image.yaml +++ b/.github/workflows/update-dev-image.yaml @@ -11,8 +11,6 @@ jobs: contents: read packages: write - if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' - steps: - uses: docker/setup-buildx-action@v3 @@ -22,9 +20,9 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/build-push-action@v5 + - uses: docker/build-push-action@v6 with: push: true - tags: ghcr.io/cssuob/tex-bot-py-v2:${{ github.ref_name }} + tags: ghcr.io/cssuob/tex-bot-py-v2:dev-${{ github.ref_name }} cache-from: type=gha cache-to: type=gha,mode=max From 1509a3eef450da796100431a53ac3b8aebee9e67 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Thu, 25 Jul 2024 00:29:20 +0100 Subject: [PATCH 3/6] Update update-dev-image.yaml --- .github/workflows/update-dev-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-dev-image.yaml b/.github/workflows/update-dev-image.yaml index 2d497d94..3f0630e9 100644 --- a/.github/workflows/update-dev-image.yaml +++ b/.github/workflows/update-dev-image.yaml @@ -23,6 +23,6 @@ jobs: - uses: docker/build-push-action@v6 with: push: true - tags: ghcr.io/cssuob/tex-bot-py-v2:dev-${{ github.ref_name }} + tags: ghcr.io/cssuob/tex-bot-py-v2:dev-${{ github.ref }} cache-from: type=gha cache-to: type=gha,mode=max From 646ea30daff12b2f1c27c86743df49656b5d42bf Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Thu, 25 Jul 2024 00:34:44 +0100 Subject: [PATCH 4/6] Update update-dev-image.yaml --- .github/workflows/update-dev-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-dev-image.yaml b/.github/workflows/update-dev-image.yaml index 3f0630e9..d95c84c5 100644 --- a/.github/workflows/update-dev-image.yaml +++ b/.github/workflows/update-dev-image.yaml @@ -23,6 +23,6 @@ jobs: - uses: docker/build-push-action@v6 with: push: true - tags: ghcr.io/cssuob/tex-bot-py-v2:dev-${{ github.ref }} + tags: ghcr.io/cssuob/tex-bot-py-v2:pr-${{ github.head_ref }} cache-from: type=gha cache-to: type=gha,mode=max From d7d81f6a61dccac4a1858347014b367a97450bf6 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:04:02 +0100 Subject: [PATCH 5/6] Update and rename update-dev-image.yaml to update-dev-container-image.yaml --- .../{update-dev-image.yaml => update-dev-container-image.yaml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{update-dev-image.yaml => update-dev-container-image.yaml} (94%) diff --git a/.github/workflows/update-dev-image.yaml b/.github/workflows/update-dev-container-image.yaml similarity index 94% rename from .github/workflows/update-dev-image.yaml rename to .github/workflows/update-dev-container-image.yaml index d95c84c5..dd331873 100644 --- a/.github/workflows/update-dev-image.yaml +++ b/.github/workflows/update-dev-container-image.yaml @@ -5,7 +5,7 @@ on: branches: [ "main" ] jobs: - build-and-push-container-image: + build-and-push-dev-container-image: runs-on: ubuntu-latest permissions: contents: read From 71aec85b5a58a88708b5b3c40943bda419618528 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:06:52 +0100 Subject: [PATCH 6/6] Update and rename update-container-image.yaml to update-prod-container-image.yaml --- ...e-container-image.yaml => update-prod-container-image.yaml} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename .github/workflows/{update-container-image.yaml => update-prod-container-image.yaml} (90%) diff --git a/.github/workflows/update-container-image.yaml b/.github/workflows/update-prod-container-image.yaml similarity index 90% rename from .github/workflows/update-container-image.yaml rename to .github/workflows/update-prod-container-image.yaml index 326d732d..b8826359 100644 --- a/.github/workflows/update-container-image.yaml +++ b/.github/workflows/update-prod-container-image.yaml @@ -8,7 +8,7 @@ on: workflow_dispatch: jobs: - build-and-push-container-image: + build-and-push-prod-container-image: runs-on: ubuntu-latest permissions: contents: read @@ -28,7 +28,6 @@ jobs: - uses: docker/build-push-action@v5 with: push: true - # noinspection SpellCheckingInspection tags: ghcr.io/cssuob/tex-bot-py-v2:latest cache-from: type=gha cache-to: type=gha,mode=max