From 8cb5c94031355c6646b2bcb6c1c98795cb0b96bb Mon Sep 17 00:00:00 2001 From: jen Date: Mon, 16 Jun 2025 23:38:14 +0100 Subject: [PATCH 1/2] chore: remove and disable heroku deployments. update deploy-development.yml to accept any heroku repository --- .github/workflows/deploy-development.yml | 8 +- .github/workflows/deploy-fcdo.yml | 48 ---------- ...in--lint-unit-build-and-publish-images.yml | 11 --- .github/workflows/smoke-tests-heroku.yml | 90 ------------------- 4 files changed, 5 insertions(+), 152 deletions(-) delete mode 100644 .github/workflows/deploy-fcdo.yml delete mode 100644 .github/workflows/smoke-tests-heroku.yml diff --git a/.github/workflows/deploy-development.yml b/.github/workflows/deploy-development.yml index ceeb41373d..ced602933c 100644 --- a/.github/workflows/deploy-development.yml +++ b/.github/workflows/deploy-development.yml @@ -9,6 +9,9 @@ on: tag: description: "Tag to use for heroku deployments" required: true + repository: + required: true + description: "The heroku repository to push to" workflow_call: inputs: app: @@ -20,7 +23,6 @@ on: required: true type: string - jobs: deploy: runs-on: ubuntu-latest @@ -36,12 +38,12 @@ jobs: run: docker pull ghcr.io/xgovformbuilder/digital-form-builder-${{ inputs.app }}:${{ inputs.tag }} - name: Tag Image - run: docker tag ghcr.io/xgovformbuilder/digital-form-builder-${{ inputs.app }}:${{ inputs.tag }} registry.heroku.com/digital-form-builder-${{ inputs.app }}/web + run: docker tag ghcr.io/xgovformbuilder/digital-form-builder-${{ inputs.app }}:${{ inputs.tag }} ${{ inputs.repository }} - name: Push to Heroku Registry env: HEROKU_API_KEY: ${{ secrets.HEROKU_DEV_API_KEY }} - run: docker push registry.heroku.com/digital-form-builder-${{ inputs.app }}/web + run: docker push ${{ inputs.repository }} - name: Release env: diff --git a/.github/workflows/deploy-fcdo.yml b/.github/workflows/deploy-fcdo.yml deleted file mode 100644 index 95454270ca..0000000000 --- a/.github/workflows/deploy-fcdo.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Deploy to FCDO Environment - -on: - workflow_dispatch: - inputs: - app: - description: "Name of the app to deploy to heroku" - required: true - tag: - description: "Tag to use for heroku deployments" - required: true - workflow_call: - inputs: - app: - description: "Name of the app to deploy to heroku" - required: true - type: string - tag: - description: "Tag to use for heroku deployments" - required: true - type: string - -jobs: - deploy: - runs-on: ubuntu-latest - name: Deploy development ${{ inputs.app }} - steps: - - uses: actions/checkout@v2 - - name: Login to Heroku Container registry - env: - HEROKU_API_KEY: ${{ secrets.HEROKU_DEV_API_KEY }} - run: heroku container:login - - - name: Pull latest ${{ inputs.app }} image - run: docker pull ghcr.io/xgovformbuilder/digital-form-builder-${{ inputs.app }}:${{ inputs.tag }} - - - name: Tag Image - run: docker tag ghcr.io/xgovformbuilder/digital-form-builder-${{ inputs.app }}:${{ inputs.tag }} registry.heroku.com/form-${{ inputs.app }}-fcdo/web - - - name: Push to Heroku Registry - env: - HEROKU_API_KEY: ${{ secrets.HEROKU_DEV_API_KEY }} - run: docker push registry.heroku.com/form-${{ inputs.app }}-fcdo/web - - - name: Release - env: - HEROKU_API_KEY: ${{ secrets.HEROKU_DEV_API_KEY }} - run: heroku container:release -a form-${{ inputs.app }}-fcdo web diff --git a/.github/workflows/main--lint-unit-build-and-publish-images.yml b/.github/workflows/main--lint-unit-build-and-publish-images.yml index b50fe9b0e4..51802204ab 100644 --- a/.github/workflows/main--lint-unit-build-and-publish-images.yml +++ b/.github/workflows/main--lint-unit-build-and-publish-images.yml @@ -65,17 +65,6 @@ jobs: publish: true app: ${{matrix.app}} - deploy: - needs: [calculate-version, assign-semver, build-and-publish-images] - uses: ./.github/workflows/deploy-development.yml - secrets: inherit - strategy: - matrix: - app: [designer, runner] - with: - app: ${{ matrix.app }} - tag: ${{ needs.assign-semver.outputs.SEMVER }} - tag-branch: runs-on: ubuntu-latest needs: [calculate-version, assign-semver, build-and-publish-images] diff --git a/.github/workflows/smoke-tests-heroku.yml b/.github/workflows/smoke-tests-heroku.yml deleted file mode 100644 index 1a723abfc6..0000000000 --- a/.github/workflows/smoke-tests-heroku.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Smoke Tests Nightly - Heroku -on: - schedule: - - cron: "0 0 * * *" - workflow_dispatch: -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: "16.x" - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn config get cacheFolder)" - - - uses: actions/cache@v3 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-e2e-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn-e2e - - - name: Run smoke tests against heroku - run: yarn e2e cypress run - env: - cypress_DESIGNER_URL: https://digital-form-builder-designer.herokuapp.com - cypress_RUNNER_URL: https://digital-form-builder-runner.herokuapp.com - - - - name: Send slack CI alert - id: slack - uses: slackapi/slack-github-action@v1.18.0 - with: - # For posting a rich message using Block Kit - payload: | - { - "blocks": [ - { - "type": "header", - "text": { - "type": "plain_text", - "text": ":rotating_light: Nightly smoke tests failed", - "emoji": true - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "GitHub Action CI result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" - } - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - - - name: Scan image - uses: anchore/scan-action@v2 - with: - image: "ghcr.io/digital-form-builder-runner:latest" - acs-report-enable: true - fail-build: false - severity-cutoff: critical - - - name: Scan image - uses: anchore/scan-action@v2 - with: - image: "ghcr.io/digital-form-builder-designer:latest" - acs-report-enable: true - fail-build: false - severity-cutoff: critical - - - deploy: - needs: test - uses: ./.github/workflows/deploy-development.yml - secrets: inherit - strategy: - matrix: - app: [ designer, runner ] - with: - app: ${{ matrix.app }} - tag: ${{ needs.assign-semver.outputs.SEMVER }} From 75f8914769018146b128bfe2b50967d9bf5889c1 Mon Sep 17 00:00:00 2001 From: jen Date: Tue, 17 Jun 2025 10:22:35 +0100 Subject: [PATCH 2/2] add docs for deploy-development --- .github/workflows/deploy-development.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/deploy-development.yml b/.github/workflows/deploy-development.yml index ced602933c..be2eb96770 100644 --- a/.github/workflows/deploy-development.yml +++ b/.github/workflows/deploy-development.yml @@ -1,3 +1,14 @@ +# This is a reusable workflow unit which can be used to deploy to heroku. +# To deploy, add the following to your workflow +#deploy: +# needs: [calculate-version, assign-semver, build-and-publish-images] +# uses: ./.github/workflows/deploy-development.yml +# secrets: inherit +# with: +# repository: # heroku repository to push to +# app: runner +# tag: ${{ needs.assign-semver.outputs.SEMVER }} + name: Deploy Development Environment on: