Skip to content

Commit

Permalink
feat: on tag publish deploy to envs (#220)
Browse files Browse the repository at this point in the history
* feat: on tag publish deploy to envs

* fix: test code

* fix: fin:
git branch

---------

Co-authored-by: Samika Kashyap <samikas@samikas-mbp.lan>
  • Loading branch information
samika98 and Samika Kashyap authored Jan 18, 2024
1 parent eaa7abd commit 2c711f2
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Publish and Deploy Image
on:
push:
branches: [ "main" ]
release:
types: [published, edited]
workflow_dispatch:

env:
Expand Down Expand Up @@ -41,7 +43,7 @@ jobs:
# Use the release tag to deploy, if one is available.
DEPLOY_TAG=$RELEASE_TAG
fi
make SHA="${{ github.SHA }}" SHA_TAG="$SHA_TAG" RELEASE_TAG="$RELEASE_TAG" publish-docker
# make SHA="${{ github.SHA }}" SHA_TAG="$SHA_TAG" RELEASE_TAG="$RELEASE_TAG" publish-docker
echo "Deploy tag:"
echo ${DEPLOY_TAG}
echo "deploy_tag=${DEPLOY_TAG}" >> $GITHUB_OUTPUT
Expand All @@ -54,6 +56,19 @@ jobs:
-
uses: actions/checkout@v3
-
# TODO: Update this when we have multiple branches and a pre/release workflow
# TODO: Uncomment and remove echo
name: Schedule k8s deployment
run: make DEPLOY_ENV="qa" DEPLOY_TAG=${{ needs.publish.outputs.deploy_tag }} schedule-k8s-deployment
run: |
echo "Workflow triggered by: ${{ github.event_name }}"
if [[ "${{github.event_name}}" == "release" ]]; then
echo "Release action: ${{ github.event.action }}"
if [${{ github.event.release.prerelease }}]; then
DEPLOY_ENV="tnet"
else
DEPLOY_ENV="prod"
fi
else
DEPLOY_ENV="qa"
fi
# make DEPLOY_ENV="$DEPLOY_ENV" DEPLOY_TAG=${{ needs.publish.outputs.deploy_tag }} schedule-k8s-deployment
echo "DEPLOY_ENV is $DEPLOY_ENV"

0 comments on commit 2c711f2

Please sign in to comment.