From 583d1b08416ba8f57d497c0a56702e70284bb197 Mon Sep 17 00:00:00 2001 From: Albert Bertram Date: Tue, 11 Feb 2025 16:07:27 -0500 Subject: [PATCH] Adding platform engineering's deployment workflows. --- .../workflows/build-deploy-on-release.yaml | 25 +++++++++++++++++ .github/workflows/build-web.yml | 25 +++++++++++++++++ .../workflows/manual-deploy-production.yml | 28 +++++++++++++++++++ .github/workflows/manual-deploy-testing.yml | 27 ++++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 .github/workflows/build-deploy-on-release.yaml create mode 100644 .github/workflows/build-web.yml create mode 100644 .github/workflows/manual-deploy-production.yml create mode 100644 .github/workflows/manual-deploy-testing.yml diff --git a/.github/workflows/build-deploy-on-release.yaml b/.github/workflows/build-deploy-on-release.yaml new file mode 100644 index 00000000..5d1af652 --- /dev/null +++ b/.github/workflows/build-deploy-on-release.yaml @@ -0,0 +1,25 @@ +name: Build and Deploy Production + +on: + release: + types: [ released ] + +jobs: + build-production: + name: Build production ${{ github.event.release.tag_name }} + uses: mlibrary/platform-engineering-workflows/.github/workflows/build-production.yml@v1 + with: + image_name: ${{ vars.IMAGE_NAME }} + tag: ${{ github.event.release.tag_name }} + dockerfile: Dockerfile + secrets: inherit + + + deploy-production: + needs: build-production + name: Deploy to production + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.release.tag_name }} + file: ${{ vars.CONFIG_REPO_PRODUCTION_IMAGE_FILE }} + secrets: inherit diff --git a/.github/workflows/build-web.yml b/.github/workflows/build-web.yml new file mode 100644 index 00000000..c39ca755 --- /dev/null +++ b/.github/workflows/build-web.yml @@ -0,0 +1,25 @@ +name: Build web on push to master + +on: + push: + branches: + - master + +jobs: + build-unstable: + name: Build unstable ${{ github.sha }} + uses: mlibrary/platform-engineering-workflows/.github/workflows/build-unstable.yml@v1 + with: + image_name: ${{ vars.IMAGE_NAME }} + tag: ${{ github.sha }} + dockerfile: Dockerfile + secrets: inherit + + deploy-testing: + needs: build-unstable + name: Deploy to testing + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ${{ needs.build-unstable.outputs.image }} + file: ${{ vars.CONFIG_REPO_TESTING_IMAGE_FILE }} + secrets: inherit diff --git a/.github/workflows/manual-deploy-production.yml b/.github/workflows/manual-deploy-production.yml new file mode 100644 index 00000000..5096be4c --- /dev/null +++ b/.github/workflows/manual-deploy-production.yml @@ -0,0 +1,28 @@ +name: Manual deploy production + +on: + workflow_dispatch: + inputs: + tag: + description: Release + required: true + + +jobs: + build-production: + name: Build production ${{ github.event.inputs.tag }} + uses: mlibrary/platform-engineering-workflows/.github/workflows/build-production.yml@v1 + with: + image_name: ${{ vars.IMAGE_NAME }} + tag: ${{ github.event.inputs.tag }} + dockerfile: Dockerfile + secrets: inherit + + deploy-production: + needs: build-production + name: Deploy to production + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.inputs.tag }} + file: ${{ vars.CONFIG_REPO_PRODUCTION_IMAGE_FILE }} + secrets: inherit diff --git a/.github/workflows/manual-deploy-testing.yml b/.github/workflows/manual-deploy-testing.yml new file mode 100644 index 00000000..362598bf --- /dev/null +++ b/.github/workflows/manual-deploy-testing.yml @@ -0,0 +1,27 @@ +name: Manual deploy workshop + +on: + workflow_dispatch: + inputs: + tag: + description: tag + required: true + +jobs: + build-unstable: + name: Build unstable ${{ github.event.inputs.tag }} + uses: mlibrary/platform-engineering-workflows/.github/workflows/build-unstable.yml@v1 + with: + image_name: ${{ vars.IMAGE_NAME }} + tag: ${{ github.event.inputs.tag }} + dockerfile: Dockerfile + secrets: inherit + + deploy: + needs: build-unstable + name: Deploy to ${{ github.event.inputs.tanka_env }} + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ${{ needs.build-unstable.outputs.image }} + file: ${{ vars.CONFIG_REPO_TESTING_IMAGE_FILE }} + secrets: inherit