Skip to content

Extract deployment to reusable workflow #3156

Extract deployment to reusable workflow

Extract deployment to reusable workflow #3156

Workflow file for this run

name: Node.js CI
on:
push:
branches:
- '*'
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvmrc
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version-file: '.nvmrc'
- run: ./bin/check-node.sh
- run: npm ci
env:
CYPRESS_INSTALL_BINARY: 0
- run: npm run lint
- run: npm run test
env:
FORCE_COLOR: true
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
build-args: |
NODE_RELEASE=${{ steps.nvmrc.outputs.NODE_VERSION }}
context: .
push: false
tags: textbook/starter-kit
windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version-file: '.nvmrc'
- run: npm ci
- run: npm run lint
- run: npm run test
env:
FORCE_COLOR: true
- run: npm run e2e
- run: npm run e2e:dev
e2e:
runs-on: ubuntu-22.04
needs: build
strategy:
matrix:
node: [ '16.17', '16', '18.3', '18', '20' ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run e2e
- run: npm run e2e:dev
deploy:
uses: './.github/workflows/deploy.yml'

Check failure on line 69 in .github/workflows/push.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/push.yml

Invalid workflow file

error parsing called workflow ".github/workflows/push.yml" -> "./.github/workflows/deploy.yml" (source branch with sha:53acc9aac05fbc3395ba3f1eb2c39af54a2642ed) : workflow is not reusable as it is missing a `on.workflow_call` trigger
if: github.ref == 'refs/heads/main'
needs:
- e2e
- windows
with:
environment: heroku
url: https://starter-kit-ci.herokuapp.com/