Migrate DeploymentConfig to Kubernetes Deployment #277
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
name: hmr-build-deploy | |
on: | |
pull_request: | |
branches: | |
- "master" | |
defaults: | |
run: | |
working-directory: . | |
jobs: | |
cancel-previous-runs: | |
runs-on: ubuntu-22.04 | |
permissions: | |
actions: write | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.9.1 | |
with: | |
access_token: ${{ github.token }} | |
build: | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
working-directory: ./.pipeline | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "18" | |
- name: Set Version | |
run: echo "VERSION=v1.0.${{ github.run_number }}" >> $GITHUB_ENV | |
- name: Build | |
run: | | |
oc version | |
oc login --token=${{ secrets.OPENSHIFT_TOKEN}} --server=${{ secrets.OPENSHIFT_SERVER_URL }} | |
npm ci | |
DEBUG=* npm run build -- --pr=${{ github.event.pull_request.number }} --git.branch.name=${{github.head_ref}} --git.ref=${{github.head_ref}} --version=${VERSION} | |
deploy-to-dev: | |
runs-on: ubuntu-22.04 | |
needs: [build] | |
defaults: | |
run: | |
working-directory: ./.pipeline | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "18" | |
- name: Set Version | |
run: echo "VERSION=v1.0.${{ github.run_number }}" >> $GITHUB_ENV | |
- name: Deploy the image | |
run: | | |
oc version | |
oc login --token=${{ secrets.OPENSHIFT_TOKEN}} --server=${{ secrets.OPENSHIFT_SERVER_URL }} | |
npm ci | |
DEBUG=* npm run deploy -- --pr=${{ github.event.pull_request.number }} --env=dev --git.branch.name=${{github.head_ref}} --git.ref=${{github.head_ref}} --version=${VERSION} | |
deploy-to-test: | |
needs: [build, deploy-to-dev] | |
environment: | |
name: test | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
working-directory: ./.pipeline | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "18" | |
- name: Deploy the image | |
run: | | |
oc version | |
oc login --token=${{ secrets.OPENSHIFT_TOKEN}} --server=${{ secrets.OPENSHIFT_SERVER_URL }} | |
npm ci | |
DEBUG=* npm run deploy -- --pr=${{ github.event.pull_request.number }} --env=test --git.branch.name=${{github.head_ref}} --git.ref=${{github.head_ref}} | |
deploy-to-uat: | |
needs: [build, deploy-to-test] | |
environment: | |
name: uat | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
working-directory: ./.pipeline | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "18" | |
- name: Deploy the image | |
run: | | |
oc version | |
oc login --token=${{ secrets.OPENSHIFT_TOKEN}} --server=${{ secrets.OPENSHIFT_SERVER_URL }} | |
npm ci | |
DEBUG=* npm run deploy -- --pr=${{ github.event.pull_request.number }} --env=uat --git.branch.name=${{github.head_ref}} --git.ref=${{github.head_ref}} | |
deploy-to-prod: | |
needs: [build, deploy-to-uat] | |
environment: | |
name: prod | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
working-directory: ./.pipeline | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "18" | |
- name: Deploy the image | |
run: | | |
oc version | |
oc login --token=${{ secrets.OPENSHIFT_TOKEN}} --server=${{ secrets.OPENSHIFT_SERVER_URL }} | |
npm ci | |
DEBUG=* npm run deploy -- --pr=${{ github.event.pull_request.number }} --env=prod --git.branch.name=${{github.head_ref}} --git.ref=${{github.head_ref}} |