chore(ci): fix netlify command due to new version + rely on the netli… #46
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 | |
- name: Deploy to Netlify | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
env: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
run: make deploy | |
- 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] |