Skip to content

Commit

Permalink
Merge pull request #5 from gallerymiguel/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
gallerymiguel authored Jan 12, 2025
2 parents 0756e0b + e299844 commit 3be2aef
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .circleci/config.yml
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
30 changes: 30 additions & 0 deletions .github/workflows/checking_tests.yml
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
27 changes: 27 additions & 0 deletions .github/workflows/deploy_to_render.yml
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"

0 comments on commit 3be2aef

Please sign in to comment.