-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
febd112
commit 7225e5a
Showing
4 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Deploy Dev | ||
name: Deploy Dev Environment | ||
|
||
on: | ||
workflow_dispatch: | ||
|
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
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 |