Skip to content

feat: add dev builds when pushing on 1-dev #2

feat: add dev builds when pushing on 1-dev

feat: add dev builds when pushing on 1-dev #2

name: Push and PR
on:
push:
branches:
- master
- beta
- "[0-9]+-dev"
pull_request:
jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: ./.github/actions/lint
functional-tests:
name: Functional Tests
runs-on: ubuntu-20.04
needs: [lint]
steps:
- uses: actions/checkout@v3
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: ./.github/actions/functional-test
release:
name: Release process
needs: [functional-tests]
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/2-dev') }}
runs-on: ubuntu-20.04
permissions:
contents: write
issues: write
pull-requests: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
scope: "@kuzzleio"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GHP }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
SEMANTIC_RELEASE_NPM_PUBLISH: "true"
SEMANTIC_RELEASE_SLACK_WEBHOOK: ${{ secrets.SEMANTIC_RELEASE_SLACK_WEBHOOK }}
run: npx semantic-release
documentation_deploy:
needs: [release]
name: Documentation - Deploy
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/2-dev') }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: convictional/trigger-workflow-and-wait@v1.6.3
with:
owner: kuzzleio
repo: documentation
github_token: ${{ secrets.ACCESS_TOKEN_CI }}
workflow_file_name: child_repo.workflow.yml
ref: ${{ github.ref_name == 'master' && 'master' || 'develop' }}
client_payload: '{"repo_name":"kuzzle-plugin-hermes-messenger","branch":"${{ github.ref_name }}","version":"1"}'