Skip to content

build

build #21

Workflow file for this run

name: build
on:
workflow_dispatch:
env:
NODE_VERSION: 20
jobs:
ci:
uses: ./.github/workflows/ci.yml
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
release-npm:
runs-on: ubuntu-latest
needs: ci
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Setup Composer cache
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-7.4-composer-${{ hashFiles('**/composer.json') }}
restore-keys: php-7.4-composer-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: |
npm ci --workspaces --no-audit --ignore-scripts
composer install --prefer-dist
- name: Run build
run: npm run build
- name: Publish to NPM
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: npx lerna publish from-package --yes --pre-dist-tag next
publish-chromatic:
uses: ./.github/workflows/chromatic.yml
needs: release-npm
secrets:
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
publish-cloudflare-pages:
uses: ./.github/workflows/cloudflare-pages.yml
needs: release-npm
secrets:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}