chore: Modernise tooling #1
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/CD | |
on: | |
push: | |
pull_request: | |
types: [opened, reopened] | |
env: | |
FORCE_COLOR: 3 # Diplay chalk colors | |
jobs: | |
ci: | |
# Watch out! When changing the job name, | |
# update the required checks in GitHub | |
# branch protection settings for `next`. | |
name: CI | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 | |
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run integration tests | |
run: pnpm run ci | |
- uses: 47ng/actions-slack-notify@main | |
name: Notify on Slack | |
if: always() | |
continue-on-error: true | |
with: | |
status: ${{ job.status }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
cd: | |
name: Deployment | |
runs-on: ubuntu-latest | |
needs: [ci] | |
if: ${{ github.ref_name == 'main' || github.ref_name == 'beta' }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 | |
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install --ignore-scripts --frozen-lockfile | |
- name: Build package | |
run: pnpm build | |
- name: Semantic Release | |
run: ./node_modules/.bin/semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |