Frontend versioning #17
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
name: Fullstack Pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- synchronize | |
jobs: | |
backend_workflow: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: cd backend && yarn install | |
- name: Lint | |
run: cd backend && yarn lint | |
- name: Test | |
run: cd backend && TEST_MONGODB_URI=${{ secrets.TEST_MONGODB_URI }} SECRET=${{ secrets.SECRET }} yarn test | |
- name: Test Failure | |
uses: BubbleProd/discord-webhook-notify@v2 | |
if: failure() | |
with: | |
severity: error | |
details: Pipeline failed | |
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} | |
frontend_tests: | |
runs-on: ubuntu-20.04 | |
needs: | |
- backend_workflow | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: cd frontend && yarn install | |
- name: Lint | |
run: cd frontend && yarn lint | |
- name: Build | |
run: cd frontend && yarn build | |
- name: Test | |
run: cd frontend && yarn test | |
- name: Test Failure | |
uses: BubbleProd/discord-webhook-notify@v2 | |
if: failure() | |
with: | |
severity: error | |
details: Pipeline failed | |
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} | |
e2e-tests_and_deploy: | |
runs-on: ubuntu-20.04 | |
needs: | |
- frontend_tests | |
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 }} | |
tag_release: | |
if: ${{ github.event_name == 'push' && !contains(join(github.event.commits.*.message, ' '), '#skip') }} | |
needs: e2e-tests_and_deploy | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Bump version and push tag | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DEFAULT_BUMP: patch | |
WITH_V: true | |
- name: Test success | |
uses: BubbleProd/discord-webhook-notify@v2 | |
if: success() | |
with: | |
severity: info | |
details: Pipeline success | |
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} |