Skip to content

CD - Web

CD - Web #18

Workflow file for this run

name: CD - Web
on:
push:
branches: [master]
paths:
- "web/**"
- "docker/web/**"
workflow_dispatch:
env:
IMAGE_NAME: web
DEPLOYMENT_ENV: dev
WORKING_DIRECTORY: ./
GITOPS_BRANCH: develop
GITOPS_LICENCE_PLATE: b3c707
ARTIFACTORY_REPO: artifacts.developer.gov.bc.ca
ARTIFACTORY_IMAGE_PATH: sb3c-images
WEB_BASE_HREF: /
jobs:
builds:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Get short SHA
id: short_sha
run: |
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build and Push API images to Artifactory
id: build_push
uses: ./.github/workflows/actions/docker-build-push-artifactory
with:
image_name: ${{ env.IMAGE_NAME }}
image_tag: ${{ env.DEPLOYMENT_ENV }}-${{ steps.short_sha.outputs.SHORT_SHA }}
image_sha: ${{ steps.short_sha.outputs.SHORT_SHA }}
artifactory_username: ${{ secrets.ARTIFACTORY_USERNAME }}
artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
artifactory_repo: ${{ env.ARTIFACTORY_REPO }}
artifactory_image_path: ${{ env.ARTIFACTORY_IMAGE_PATH }}
build_dockerfile: ./docker/web/Dockerfile.release
docker_build_args: |
WEB_BASE_HREF=${{ env.WEB_BASE_HREF }}
NGINX_RUNTIME_SRC=../../docker/nginx-runtime
VUE_ON_NGINX_SRC=../../docker/vue-on-nginx
WEB_SRC=../../web
- name: Update ArgoCD Repo
id: update_argo_repo
if: steps.build_push.outcome == 'success'
uses: ./.github/workflows/actions/update-argo-repo
with:
licence_plate: ${{ env.GITOPS_LICENCE_PLATE }}
gitops_branch: ${{ env.GITOPS_BRANCH }}
gitops_ssh_key: ${{ secrets.GIT_OPS_SSH_KEY }}
image_tag: ${{ env.DEPLOYMENT_ENV }}-${{ steps.short_sha.outputs.SHORT_SHA }}
helm_property: webtag
helm_paths: web/values.yaml ../deploy/${{ env.DEPLOYMENT_ENV }}_values.yaml