chore(deps): update ghcr.io/bcgov/nr-containers/postgres docker tag to v15.6 #57
Workflow file for this run
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: Build and Deploy of Job on Pull Request to Main | |
on: | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
# PR open and close use the same group, allowing only one at a time | |
group: pr-${{ github.workflow }}-${{ github.event.number }} | |
cancel-in-progress: true | |
jobs: | |
extract_version: | |
name: Extract Version | |
if: '!github.event.pull_request.head.repo.fork' | |
runs-on: ubuntu-22.04 | |
outputs: | |
app_version: ${{ steps.read_yaml.outputs.app_version }} | |
available: ${{ steps.read_yaml.outputs.available }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Extract Version | |
id: read_yaml | |
shell: bash | |
run: | | |
appVersion=$(yq '.appVersion' charts/nr-metabase/Chart.yaml) | |
echo "app version is $appVersion" | |
echo "app_version=$appVersion" >> "$GITHUB_OUTPUT" | |
if [ "$appVersion" != '' ]; then | |
echo "available=false" >> $GITHUB_OUTPUT; | |
else | |
echo "available=true" >> $GITHUB_OUTPUT; | |
fi | |
- name: Get App Version | |
run: echo "${{ steps.read_yaml.outputs.app_version }}" | |
builds: | |
name: Builds | |
needs: extract_version | |
if: '!github.event.pull_request.head.repo.fork && ${{ needs.extract_version.outputs.available == true }}' | |
runs-on: ubuntu-22.04 | |
permissions: | |
packages: write | |
steps: | |
- uses: bcgov-nr/action-builder-ghcr@v2.0.1 | |
with: | |
package: metabase | |
tag: ${{ github.sha }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
build_args: | | |
METABASE_VERSION=${{ needs.extract_version.outputs.app_version }} | |
- uses: shrink/actions-docker-registry-tag@v3 | |
with: | |
registry: ghcr.io | |
repository: ${{ github.repository }}/metabase | |
target: ${{ github.sha }} | |
tags: | | |
pr-${{ github.event.number }} | |
${{ needs.extract_version.outputs.app_version }} | |
deploys: | |
name: Deploys | |
needs: | |
- builds | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Deploy to OpenShift | |
shell: bash | |
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 }} | |
# Deploy Helm Chart | |
helm upgrade --install --wait --atomic nr-metabase-${{ github.event.number }} --set-string global.secrets.databasePassword=${{ secrets.DB_PASSWORD}} --set-string global.zone="${{ github.event.number }}" --set-string metabase.image.tag=${{ github.sha }} --set namespace=${{ vars.oc_namespace }} --timeout 5m charts/nr-metabase --debug |