ci: add deploy job to ci workflow (#2) #10
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install node, npm, and dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Build Packages | |
run: npm run build | |
shell: bash | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install node, npm, and dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Run unit tests | |
run: npm run test:ci | |
shell: bash | |
- name: Cypress run | |
uses: cypress-io/github-action@v6 | |
with: | |
browser: chrome | |
start: npm start | |
env: | |
CYPRESS_AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }} | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install node, npm, and dependencies | |
uses: ./.github/actions/install-dependencies | |
- name: Lint Packages | |
run: npm run lint | |
shell: bash | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build, test, lint] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Deploy to Render | |
env: | |
DEPLOY_HOOK_URL: ${{ secrets.RENDER_DEPLOY_HOOK_URL}} | |
run: curl "$DEPLOY_HOOK_URL" | |
shell: bash | |
- name: Release | |
run: npm run release --ci |