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

wait for server #9

Merged
merged 7 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
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
71 changes: 25 additions & 46 deletions .github/workflows/fullstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
severity: error
details: Pipeline failed
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
frontend_tests:
frontend_deployment:
runs-on: ubuntu-20.04
needs:
- backend_workflow
Expand All @@ -60,53 +60,32 @@ jobs:
severity: error
details: Pipeline failed
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
e2e-tests_and_deploy:
runs-on: ubuntu-20.04
needs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install frontend and backend packages
run: cd frontend && yarn install && cd ../backend && yarn install
- name: Start server
run: yarn start:test-background
working-directory: ./backend
- name: wait for server
run: yarn wait-on http://localhost:3001
- name: E2E Tests
uses: cypress-io/github-action@v5
with:
working-directory: ./frontend
command: yarn test:e2e
wait-on: http://localhost:3001
browser: chrome
record: true
- name: Deploy to production
id: deploy
env:
COMMIT_MESSAGES: ${{ join(github.event.commits.*.message, ' ') }}
if: ${{ github.event_name == 'push' && !contains(env.COMMIT_MESSAGES, '#skip') }}
uses: johnbeynon/[email protected]
with:
service-id: ${{ secrets.RENDER_SERVICE_ID }}
api-key: ${{ secrets.RENDER_API_KEY }}
- name: Test Failure
uses: BubbleProd/discord-webhook-notify@v2
if: failure()
with:
severity: error
details: Pipeline failed
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: Test Failure at Deploy
uses: BubbleProd/discord-webhook-notify@v2
if: ${{ steps.deploy.conclusion == 'failure' }}
with:
severity: error
details: ${{ steps.deploy.outputs.message }}
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: Deploy to production
id: deploy
env:
COMMIT_MESSAGES: ${{ join(github.event.commits.*.message, ' ') }}
if: ${{ github.event_name == 'push' && !contains(env.COMMIT_MESSAGES, '#skip') }}
uses: johnbeynon/[email protected]
with:
service-id: ${{ secrets.RENDER_SERVICE_ID }}
api-key: ${{ secrets.RENDER_API_KEY }}
- name: Test Failure
uses: BubbleProd/discord-webhook-notify@v2
if: failure()
with:
severity: error
details: Pipeline failed
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: Test Failure at Deploy
uses: BubbleProd/discord-webhook-notify@v2
if: ${{ steps.deploy.conclusion == 'failure' }}
with:
severity: error
details: ${{ steps.deploy.outputs.message }}
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
tag_release:
if: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message, ' '), '#skip') }}
needs: e2e-tests_and_deploy
needs: frontend_deployment
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion backend/src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ if (process.env.NODE_ENV === "test") {
MONGODB_URI = process.env.MONGODB_URI || "";
}

const PORT = process.env.PORT || "";
const PORT = process.env.PORT || 3001;

export { MONGODB_URI, PORT };