Skip to content

Build latest from main and Auto-Deploy to Testing and Staging #246

Build latest from main and Auto-Deploy to Testing and Staging

Build latest from main and Auto-Deploy to Testing and Staging #246

Workflow file for this run

name: Build latest from main and Auto-Deploy to Testing and Staging
on:
workflow_run:
workflows: [ 'Run Tests' ]
branches: [ 'main' ]
types: [ completed ]
jobs:
build-unstable:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: mlibrary/platform-engineering-workflows/.github/workflows/build-unstable.yml@v1
with:
image_name: ${{ vars.IMAGE_NAME }}
tag: ${{ github.sha }}
dockerfile: Dockerfile
secrets: inherit
scan-image:
needs: build-unstable
runs-on: ubuntu-latest
steps:
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ needs.build-unstable.outputs.image }}
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
skip-files: '/gems/ruby/3.2.0/gems/openid_connect-2.2.0/spec/mock_response/public_keys/private_key.pem'
deploy-testing:
needs: build-unstable
runs-on: ubuntu-latest
environment: testing
steps:
- name: Deploy to Testing
uses: mlibrary/deploy-to-kubernetes@v3
with:
registry_token: ${{ secrets.GITHUB_TOKEN }}
image: ${{ needs.build-unstable.outputs.image }}
cluster_ca: ${{ secrets.HATCHER_CLUSTER_CA }}
cluster_server: https://hatcher.kubernetes.lib.umich.edu
namespace_token: ${{ secrets.HATCHER_TOKEN }}
namespace: ${{ secrets.NAMESPACE }}
deploy-staging:
needs: build-unstable
runs-on: ubuntu-latest
environment: staging
steps:
- name: Deploy to Staging
uses: mlibrary/deploy-to-kubernetes@v3
with:
registry_token: ${{ secrets.GITHUB_TOKEN }}
image: ${{ needs.build-unstable.outputs.image }}
cluster_ca: ${{ secrets.HATCHER_CLUSTER_CA }}
cluster_server: https://hatcher.kubernetes.lib.umich.edu
namespace_token: ${{ secrets.HATCHER_TOKEN }}
namespace: ${{ secrets.NAMESPACE }}