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

fix(cicd): Try to create rdev if happy update fails in PR #5798

Closed
wants to merge 2 commits into from
Closed
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
19 changes: 7 additions & 12 deletions .github/workflows/rdev-update-for-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_REPO: ${{ secrets.ECR_REPO }}/
STACK_NAME: pr-${{ github.event.number }}
HAPPY_VERSION: "0.92.0"

permissions:
id-token: write
Expand Down Expand Up @@ -62,7 +63,7 @@ jobs:
--docker-compose-env-file envfile --aws-profile "" \
--tags ${IMAGE_TAG},${STACK_NAME},branch-$(echo ${GITHUB_REF_NAME} | sed 's/[\+\/]/-/g')

create-rdev:
deploy-rdev:
runs-on: ubuntu-22.04
needs:
- build-images
Expand All @@ -84,24 +85,18 @@ jobs:
id: pre_happy
run: |
echo "IMAGE_TAG=sha-${GITHUB_SHA:0:8}" >> $GITHUB_OUTPUT
if [[ "${{ github.event.action }}" != "synchronize" ]]; then
echo "operation=create" >> $GITHUB_OUTPUT
else
echo "operation=update" >> $GITHUB_OUTPUT
# Check if the pull request was recently created, in the last 5min. If so skip updating the rdev.
fi
- name: Create/Update deployment
- name: Update deployment
if: github.event.action == 'synchronize'
uses: chanzuckerberg/github-actions/.github/actions/deploy-happy-stack@deploy-happy-stack-v1.7.2
continue-on-error: true
with:
tfe-token: ${{ secrets.TFE_TOKEN }}
stack-name: ${{ env.STACK_NAME }}
operation: ${{ steps.pre_happy.outputs.operation }}
tag: ${{ steps.pre_happy.outputs.IMAGE_TAG }}
happy_version: "0.92.0"
happy_version: ${{ env.HAPPY_VERSION }}

summarize:
runs-on: ubuntu-22.04
needs:
- create-rdev
if: github.event.action == 'opened'
steps:
- name: Summerize deployment
Expand Down