-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from bcgov/chore/remove-pr-deploy-openshift
chore: remove openshift, deploy to github pages for PR pipeline
- Loading branch information
Showing
7 changed files
with
38 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,44 @@ | ||
name: Deploy to OpenShift on PR | ||
name: PR | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
concurrency: preview-${{ github.ref }} | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
jobs: | ||
pr-description-add: | ||
name: PR Description Add | ||
runs-on: ubuntu-24.04 | ||
permissions: | ||
pull-requests: write | ||
timeout-minutes: 1 | ||
build-and-deploy: | ||
runs-on: ubuntu-22.04 | ||
defaults: | ||
run: | ||
working-directory: ./patterns | ||
steps: | ||
- uses: bcgov-nr/[email protected] | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
if: github.event.action != 'closed' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
add_markdown: | | ||
--- | ||
Thanks for the PR! | ||
Deployments, as required, will be available below: | ||
- [Frontend](https://${{ github.event.repository.name }}-${{ github.event.number }}.apps.silver.devops.gov.bc.ca) | ||
builds: | ||
name: Builds | ||
runs-on: ubuntu-24.04 | ||
permissions: | ||
packages: write | ||
strategy: | ||
matrix: | ||
package: [frontend] | ||
include: | ||
- package: frontend | ||
triggers: ('patterns/') | ||
build_file: ./patterns/Dockerfile | ||
build_context: ./patterns | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: bcgov-nr/[email protected] | ||
with: | ||
package: ${{ matrix.package }} | ||
tag: pr-${{ github.event.number }} | ||
tag_fallback: test | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
triggers: ${{ matrix.triggers }} | ||
build_context: ${{ matrix.build_context }} | ||
build_file: ${{ matrix.build_file }} | ||
deploys: | ||
name: Deploys | ||
needs: [builds] | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Checkout | ||
- name: Deploy to OpenShift | ||
shell: bash | ||
node-version: 20 | ||
cache: npm | ||
cache-dependency-path: patterns/package-lock.json | ||
|
||
- name: Install dependencies | ||
if: github.event.action != 'closed' | ||
run: npm ci --ignore-scripts | ||
- name: Install Dependencies and Build For PR🔧 | ||
if: github.event.action != 'closed' | ||
env: | ||
BASE_URL: /nr-architecture-patterns-library/pr-preview/pr-${{github.event.number}} | ||
run: | | ||
# Allow pipefail, since we could be catching oc create errors | ||
set +o pipefail | ||
# Login to OpenShift (NOTE: project command is a safeguard) | ||
oc login --token=${{ secrets.oc_token }} --server=${{ vars.oc_server }} | ||
oc project ${{ vars.oc_namespace }} | ||
helm uninstall ${{ github.event.repository.name }}-${{ github.event.number }} || true | ||
# Deploy Helm Chart | ||
cd charts/${{ github.event.repository.name }} | ||
helm dependency update | ||
helm upgrade --install --wait --atomic ${{ github.event.repository.name }}-${{ github.event.number }} \ | ||
--set-string global.tag="pr-${{ github.event.number }}" \ | ||
--set-string global.repository="${{ github.repository }}" \ | ||
-f values.yaml --timeout 5m . | ||
npm run build | ||
- name: Deploy preview | ||
uses: rossjrw/pr-preview-action@v1 | ||
with: | ||
source-dir: ./patterns/build |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.