-
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.
Merge pull request #5 from gallerymiguel/develop
Develop
- Loading branch information
Showing
3 changed files
with
112 additions
and
0 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 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
cypress: cypress-io/[email protected] | ||
|
||
jobs: | ||
start-server: | ||
docker: | ||
- image: cypress/base:latest | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install dependencies | ||
command: npm install | ||
- run: | ||
name: Build the app | ||
command: npm run build | ||
deploy-to-render-staging: | ||
docker: | ||
- image: cimg/base:current | ||
steps: | ||
- run: | ||
name: Deploy to Render Staging | ||
command: | | ||
echo "Deploying to Render Staging" | ||
curl $RENDER_STAGING_DEPLOYHOOK | ||
deploy-to-render-production: | ||
docker: | ||
- image: cimg/base:current | ||
steps: | ||
- run: | ||
name: Deploy to Render Production | ||
command: | | ||
echo "Deploying to Render production" | ||
curl $RENDER_PRODUCTION_DEPLOYHOOK | ||
workflows: | ||
run-tests-and-deploy-to-staging-then-production: | ||
jobs: | ||
- start-server | ||
- cypress/run: | ||
name: run-component-tests | ||
cypress-command: npx cypress run --component | ||
- deploy-to-render-staging: | ||
requires: | ||
- run-component-tests | ||
filters: | ||
branches: | ||
only: main | ||
- deploy-to-render-production: | ||
requires: | ||
- deploy-to-render-staging | ||
filters: | ||
branches: | ||
only: main |
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,30 @@ | ||
name: Cypress Checking Tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- staging | ||
|
||
jobs: | ||
test: | ||
name: Cypress Checking Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 21.x | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build App | ||
run: npm run build | ||
|
||
- name: Run Cypress tests | ||
run: npm run test-component |
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,27 @@ | ||
name: Cypress Test Deploy To Render | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
ci: | ||
name: Cypress Test Deploy To Render | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Test | ||
run: | | ||
npm install | ||
npm run test-component | ||
- name: Deploy | ||
# Only run this step if the branch is main | ||
if: github.ref == 'refs/heads/main' | ||
env: | ||
deploy_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }} | ||
run: | | ||
curl "$deploy_url" |