Skip to content

Move secrets to inputs #2

Move secrets to inputs

Move secrets to inputs #2

Workflow file for this run

name: API
on:
push:
branches: [master]
paths:
- "api/**"
- "docker/api/**"
- ".github/workflows/actions/**"
- ".github/workflows/cd-api.yaml"
workflow_dispatch:
env:
IMAGE_NAME: api
IMAGE_TAG_PREFIX: dev
WORKING_DIRECTORY: ./
GITOPS_BRANCH: develop
GITOPS_LICENCE_PLATE: b3c707
ARTIFACTORY_REPO: artifacts.developer.gov.bc.ca
ARTIFACTORY_IMAGE_PATH: sbc3-images
BUILD_DOCKERFILE: api/Dockerfile.release
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Get short SHA
id: short_sha
run: |
echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)"
echo "Short SHA: $SHORT_SHA"
- 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.IMAGE_TAG_PREFIX }}-${{ 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: ${{ env.BUILD_DOCKERFILE }}
- 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 }}
image_tag: ${{ env.IMAGE_TAG_PREFIX }}-${{ steps.short_sha.outputs.SHORT_SHA }}
helm_property: /apitag
helm_paths: "api/values.yaml ../develop/values.yaml"