Skip to content

Commit

Permalink
Merge pull request #46212 from Expensify/Rory-WebDeployVerification
Browse files Browse the repository at this point in the history
[No QA] Add verification for web deploy
  • Loading branch information
AndrewGable authored Jul 25, 2024
2 parents 828e8c0 + cfd452d commit ac56415
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/platformDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,24 @@ jobs:
env:
CF_API_KEY: ${{ secrets.CLOUDFLARE_TOKEN }}

- name: Verify staging deploy
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: |
DOWNLOADED_VERSION="$(wget -q -O /dev/stdout https://staging.new.expensify.com/version.json | jq -r '.version')"
if [[ '${{ github.ref_name }}' != "$DOWNLOADED_VERSION" ]]; then
echo "Error: deployed version does not match local version. Something went wrong..."
exit 1
fi
- name: Verify production deploy
if: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
run: |
DOWNLOADED_VERSION="$(wget -q -O /dev/stdout https://new.expensify.com/version.json | jq -r '.version')"
if [[ '${{ github.event.release.tag_name }}' != "$DOWNLOADED_VERSION" ]]; then
echo "Error: deployed version does not match local version. Something went wrong..."
exit 1
fi
- name: Upload web build to GitHub artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions workflow_tests/mocks/platformDeployMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ const PLATFORM_DEPLOY__WEB__BUILD__STEP_MOCK = createMockStep('Build web', 'Buil
const PLATFORM_DEPLOY__WEB__BUILD_STORYBOOK_DOCS__STEP_MOCK = createMockStep('Build storybook docs', 'Build storybook docs', 'WEB');
const PLATFORM_DEPLOY__WEB__DEPLOY_S3__STEP_MOCK = createMockStep('Deploy to S3', 'Deploying to S3', 'WEB');
const PLATFORM_DEPLOY__WEB__PURGE_CLOUDFLARE_CACHE__STEP_MOCK = createMockStep('Purge Cloudflare cache', 'Purging Cloudflare cache', 'WEB', null, ['CF_API_KEY']);
const PLATFORM_DEPLOY__WEB__VERIFY_STAGING_DEPLOY = createMockStep('Verify staging deploy', 'Verifying staging deploy', 'WEB');
const PLATFORM_DEPLOY__WEB__VERIFY_PROD_DEPLOY = createMockStep('Verify production deploy', 'Verifying production deploy', 'WEB');
const PLATFORM_DEPLOY__WEB__UPlOAD_TO_GH_ARTIFACTS__STEP_MOCK = createMockStep('Upload web build to GitHub artifacts', 'Uploading web build to GitHub artifacts', 'WEB');
const PLATFORM_DEPLOY__WEB__UPLOAD_TO_GH_RELEASE__STEP_MOCK = createMockStep('Upload web build to GitHub Release', 'Uploading web build to GitHub Release', 'WEB', null, ['GITHUB_TOKEN']);
const PLATFORM_DEPLOY__WEB__STEP_MOCKS = [
Expand All @@ -192,6 +194,8 @@ const PLATFORM_DEPLOY__WEB__STEP_MOCKS = [
PLATFORM_DEPLOY__WEB__BUILD_STORYBOOK_DOCS__STEP_MOCK,
PLATFORM_DEPLOY__WEB__DEPLOY_S3__STEP_MOCK,
PLATFORM_DEPLOY__WEB__PURGE_CLOUDFLARE_CACHE__STEP_MOCK,
PLATFORM_DEPLOY__WEB__VERIFY_STAGING_DEPLOY,
PLATFORM_DEPLOY__WEB__VERIFY_PROD_DEPLOY,
PLATFORM_DEPLOY__WEB__UPlOAD_TO_GH_ARTIFACTS__STEP_MOCK,
PLATFORM_DEPLOY__WEB__UPLOAD_TO_GH_RELEASE__STEP_MOCK,
];
Expand Down

0 comments on commit ac56415

Please sign in to comment.