Merge branch 'dev' #44
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
env: | |
NODE_OPTIONS: --max_old_space_size=4096 | |
NODE_VERSION: 18.16.0 | |
PNPM_VERSION: 8.6.1 | |
concurrency: | |
# Prevent parallel builds of the same branch | |
group: cicd-${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
requirements: | |
name: Continuous Integration | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
id: pnpm-install | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
run_install: false | |
- name: Export pnpm store directory as an environment variable | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: make deps | |
- name: Lint | |
run: make lint | |
- name: Format check | |
run: make format-check | |
- name: Test unit | |
run: make test-unit | |
- name: Prepare building | |
run: make build-prepare | |
- name: Build | |
env: | |
CRISP_WEBSITE_ID: ${{ secrets.CRISP_WEBSITE_ID }} | |
run: make build && cat apps/docs/dist/main/stories.json | |
- name: Deploy to Netlify | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
uses: netlify/actions/cli@master | |
with: | |
args: deploy --dir=apps/docs/dist --prod | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
- name: Release package | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
working-directory: packages/dsfr-connect | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: pnpx [email protected] |