Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: on tag publish deploy to envs #220

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"