Skip to content

Commit

Permalink
chore: artifactory ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
ychung-mot committed Apr 16, 2024
1 parent febd112 commit 7225e5a
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
ENV_NAME=prod \
IMAGE_TAG_FRONTEND=${vtag//v} \
IMAGE_TAG_BACKEND=${vtag//v} \
working-directory: ./helm/main
working-directory: ./helm/main
2 changes: 1 addition & 1 deletion .github/workflows/deploy-uat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
ENV_NAME=uat \
IMAGE_TAG_FRONTEND=${vtag//v} \
IMAGE_TAG_BACKEND=${vtag//v} \
working-directory: ./helm/main
working-directory: ./helm/main
2 changes: 1 addition & 1 deletion .github/workflows/helm-deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy Dev
name: Deploy Dev Environment

on:
workflow_dispatch:
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/helm-deploy-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Create Version Tag and Deploy Test Environment

on:
workflow_dispatch:
inputs:
tag:
type: string
description: Tag Version (exclude prefix; e.g. 1.2.3)
required: true

jobs:
tag:
runs-on: ubuntu-22.04
timeout-minutes: 10
permissions:
contents: write
issues: write
pull-requests: write

steps:
- name: Fail on tags
run: exit 1
if: ${{ !startsWith(github.ref, 'refs/heads/') }}

- name: Validate Tag Input
id: input
run: |
vtag=${{ github.event.inputs.tag }}
echo "tag=${vtag//v}" >> $GITHUB_OUTPUT
- uses: hmarr/debug-action@a701ed95a46e6f2fb0df25e1a558c16356fae35a
- uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5
with:
fetch-depth: 0 # fetch all history for all branches and tags
# https://medium.com/prompt/trigger-another-github-workflow-without-using-a-personal-access-token-f594c21373ef
ssh-key: "${{ secrets.COMMIT_KEY }}"

- name: Create Git Tag
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git config commit.gpgsign false
git tag v${{ steps.input.outputs.tag }} -m "Release v${{ steps.input.outputs.tag }}"
git push --tags origin
- name: Push Docker image to Artifactory
run: |
docker login artifacts.developer.gov.bc.ca -u ${{ secrets.JFROG_USERNAME }} -p ${{ secrets.JFROG_PASSWORD }}
docker tag artifacts.developer.gov.bc.ca/sf4a-strdss/strdss-backend:latest artifacts.developer.gov.bc.ca/sf4a-strdss/strdss-backend:v${{ steps.input.outputs.tag }}
docker tag artifacts.developer.gov.bc.ca/sf4a-strdss/strdss-frontend:latest artifacts.developer.gov.bc.ca/sf4a-strdss/strdss-frontend:v${{ steps.input.outputs.tag }}
- name: Deploy apps with Helm chart
run: |
vtag=${{ github.ref_name }}
make upgrade \
NAMESPACE=f4a30d-dev \
NAME=strdss-test \
ENV_NAME=test \
IMAGE_TAG_FRONTEND=${vtag//v} \
IMAGE_TAG_BACKEND=${vtag//v} \
working-directory: ./helm/main

0 comments on commit 7225e5a

Please sign in to comment.