-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Confirming MR yml job is functioning appropriately :)
Checkly CI/CD refinement
- Loading branch information
Showing
12 changed files
with
237 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Checkly Fail Safe | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
jobs: | ||
test-e2e: | ||
if: github.event.pull_request.merged == true | ||
name: Merge Test Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
- name: Restore or cache node_modules | ||
id: cache-node-modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: node_modules | ||
key: node-modules-${{ hashFiles('package-lock.json') }} | ||
- name: Install dependencies | ||
if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
run: cd next-webstore && npm ci | ||
- name: Set Environment Variables | ||
run: | | ||
if [ ${{ github.ref }} = 'refs/heads/main' ]; then | ||
echo "NEXT_PUBLIC_NODE_ENV=production" >> $GITHUB_ENV | ||
else if [ ${{ github.ref }} = 'refs/heads/staging' ]; then | ||
echo "NEXT_PUBLIC_NODE_ENV=staging" >> $GITHUB_ENV | ||
else | ||
echo "NEXT_PUBLIC_NODE_ENV=test" >> $GITHUB_ENV | ||
fi | ||
- name: Run checks | ||
id: run-checks | ||
run: NEXT_PUBLIC_NODE_ENV=${{ env.NEXT_PUBLIC_NODE_ENV }} npx checkly test | ||
-e NEXT_PUBLIC_NODE_ENV=${{ env.NEXT_PUBLIC_NODE_ENV }} NEXT_PUBLIC_ENVIRONMENT_URL=${{ env.ENVIRONMENT_URL }} \ | ||
--reporter=github | ||
--record | ||
- name: Create summary | ||
id: create-summary | ||
run: cat checkly-github-report.md > $GITHUB_STEP_SUMMARY | ||
- name: Deploy checks | ||
id: deploy-checks | ||
if: steps.run-checks.outcome == 'success' && github.ref == 'refs/heads/main' | ||
run: npx checkly deploy --force | ||
- name: Rollback | ||
if: steps.run-checks.outcome != 'success' && github.ref == 'refs/heads/main' | ||
run: | | ||
git revert HEAD | ||
git push origin main | ||
- name: Deploy checks | ||
if: steps.run-checks.outcome == 'success' | ||
working-directory: next-webstore | ||
run: | | ||
echo "yes" | NEXT_PUBLIC_NODE_ENV=${{ env.NEXT_PUBLIC_NODE_ENV }} npx checkly deploy |
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
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
Oops, something went wrong.
989aac0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
next-danube-webshop-backend – ./server
next-danube-webshop-backend-modern-sapien.vercel.app
next-danube-webshop-backend-git-main-modern-sapien.vercel.app
next-danube-webshop-backend.vercel.app
989aac0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
next-danube-webshop – ./next-webstore
next-danube-webshop-modern-sapien.vercel.app
next-danube-webshop.vercel.app
next-danube-webshop-git-main-modern-sapien.vercel.app