From 5803140de255bb56d99408c93cc8edfd62a0476d Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 14 Feb 2024 14:31:50 -0800 Subject: [PATCH] Restore workflows --- .github/workflows/pr-open.yml | 141 ++++++++++++++++------------------ 1 file changed, 65 insertions(+), 76 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index d1eac5f63..979bec156 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -9,87 +9,76 @@ concurrency: cancel-in-progress: true jobs: - # # https://github.com/bcgov-nr/action-builder-ghcr - # builds: - # name: Builds - # runs-on: ubuntu-22.04 - # permissions: - # packages: write - # outputs: - # digest: ${{ steps.builds.outputs.digest }} - # strategy: - # matrix: - # package: [migrations, backend, frontend] - # timeout-minutes: 10 - # steps: - # - uses: bcgov-nr/action-builder-ghcr@v2.0.2 - # id: builds - # with: - # keep_versions: 50 - # package: ${{ matrix.package }} - # tag: ${{ github.event.number }} - # tag_fallback: latest - # # triggers: ('${{ matrix.package }}/') + # https://github.com/bcgov-nr/action-builder-ghcr + builds: + name: Builds + runs-on: ubuntu-22.04 + permissions: + packages: write + outputs: + digest: ${{ steps.builds.outputs.digest }} + strategy: + matrix: + package: [migrations, backend, frontend] + timeout-minutes: 10 + steps: + - uses: bcgov-nr/action-builder-ghcr@v2.0.2 + id: builds + with: + keep_versions: 50 + package: ${{ matrix.package }} + tag: ${{ github.event.number }} + tag_fallback: latest + triggers: ('${{ matrix.package }}/') - # # https://github.com/bcgov-nr/action-deployer-openshift - # deploys: - # name: Deploys - # needs: [builds] - # uses: ./.github/workflows/.deploy.yml - # secrets: inherit - # with: - # build_outputs: ${{ needs.builds.outputs.digest }} - # tag: ${{ github.event.number }} - # release: ${{ github.event.number }} + # https://github.com/bcgov-nr/action-deployer-openshift + deploys: + name: Deploys + needs: [builds] + uses: ./.github/workflows/.deploy.yml + secrets: inherit + with: + build_outputs: ${{ needs.builds.outputs.digest }} + tag: ${{ github.event.number }} + release: ${{ github.event.number }} - test: - name: Test - # needs: [deploys] - uses: bcgov/quickstart-openshift-helpers/test.yml@main - # secrets: - # oc_namespace: ${{ vars.OC_NAMESPACE }} - # oc_token: ${{ secrets.OC_TOKEN }} - # with: - # cleanup: helm - # packages: backend frontend migrations + validate: + name: Validate + needs: [deploys] + if: always() && (!cancelled()) && (!failure()) + env: + DOMAIN: apps.silver.devops.gov.bc.ca + PREFIX: ${{ github.event.repository.name }} + permissions: + pull-requests: write + runs-on: ubuntu-22.04 + steps: + - uses: amannn/action-semantic-pull-request@v5.4.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # validate: - # name: Validate - # needs: [deploys] - # if: always() && (!cancelled()) && (!failure()) - # env: - # DOMAIN: apps.silver.devops.gov.bc.ca - # PREFIX: ${{ github.event.repository.name }} - # permissions: - # pull-requests: write - # runs-on: ubuntu-22.04 - # steps: - # - uses: amannn/action-semantic-pull-request@v5.4.0 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: failure() + run: | + echo "Please use conventional commits in your PR title and re-run this job." + echo "https://www.conventionalcommits.org/en/v1.0.0/" + exit 1 - # - if: failure() - # run: | - # echo "Please use conventional commits in your PR title and re-run this job." - # echo "https://www.conventionalcommits.org/en/v1.0.0/" - # exit 1 + - uses: bcgov-nr/action-pr-description-add@v1.1.1 + env: + DOMAIN: apps.silver.devops.gov.bc.ca + PREFIX: ${{ github.event.repository.name }} + with: + add_markdown: | + --- - # - uses: bcgov-nr/action-pr-description-add@v1.1.1 - # env: - # DOMAIN: apps.silver.devops.gov.bc.ca - # PREFIX: ${{ github.event.repository.name }} - # with: - # add_markdown: | - # --- + Thanks for the PR! - # Thanks for the PR! + Deployments, as required, will be available below: + - [Frontend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}) + - [Backend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}/api) - # Deployments, as required, will be available below: - # - [Frontend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}) - # - [Backend](https://${{ env.PREFIX }}-${{ github.event.number }}-frontend.${{ env.DOMAIN }}/api) + Please create PRs in draft mode. Mark as ready to enable: + - [Analysis Workflow](https://github.com/${{ github.repository }}/actions/workflows/analysis.yml) - # Please create PRs in draft mode. Mark as ready to enable: - # - [Analysis Workflow](https://github.com/${{ github.repository }}/actions/workflows/analysis.yml) - - # After merge, new images are deployed in: - # - [Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge.yml) + After merge, new images are deployed in: + - [Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge.yml)