chore(deps): update metabase/metabase docker tag to v0.51.1 #117
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-24.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 '.metabase.metabaseImage.tag' charts/nr-metabase/values.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-24.04 | |
permissions: | |
packages: write | |
steps: | |
- uses: bcgov-nr/action-builder-ghcr@v2.2.0 | |
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@v4 | |
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-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: redhat-actions/openshift-tools-installer@v1 | |
with: | |
oc: "4" | |
- 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 |