Skip to content

Instantly share code, notes, and snippets.

@keriat
Last active February 1, 2022 19:39
Show Gist options
  • Save keriat/4c0bbd19d1ba3ec948c3f6c409ed1e35 to your computer and use it in GitHub Desktop.
Save keriat/4c0bbd19d1ba3ec948c3f6c409ed1e35 to your computer and use it in GitHub Desktop.
GitHub Actions: Continuous integration
name: Cancel previous runs
on:
push:
branches:
- main
- next
pull_request:
jobs:
cancel:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: styfle/[email protected]
with:
workflow_id: 8756852, 8756881
access_token: ${{ secrets.GH_TOKEN }}
name: Release
on:
workflow_dispatch:
push:
branches:
- main
- next
jobs:
release:
name: Release to npm
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 14.x
registry-url: https://registry.yarnpkg.com
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run semantic release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn release
name: Semantic PR title
on:
pull_request_target:
types:
- opened
- edited
- synchronize
jobs:
main:
name: Check PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment