Skip to content

chore(deps): Update react monorepo #576

chore(deps): Update react monorepo

chore(deps): Update react monorepo #576

on:
push:
branches:
- '**'
paths-ignore:
- '**.md'
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
name: lint_build_publish
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Setup Node and pnpm-store cache
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Dump versions
run: |
echo "node: $(node -v)"
echo "npm: $(npm -v)"
echo "pnpm: $(pnpm -v)"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup script cache
uses: actions/cache@v3
with:
path: node_modules/.cache
key: script-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-run-id-${{ github.run_id }}
restore-keys: script-cache-${{ hashFiles('**/pnpm-lock.yaml') }}-run-id-
- name: Run lint
run: pnpm lint
build:
name: Build
needs: lint
runs-on: ubuntu-latest
env:
VITE_GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Setup Node and pnpm-store cache
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: ${{ env.BRANCH_NAME == 'main' && 'pnpm build:prod' || 'pnpm build:dev' }}
- name: Cache build
uses: actions/cache@v3
with:
path: dist
key: ${{ github.sha }}-${{ github.run_number }}
- name: Expose build report
uses: actions/upload-artifact@v3
with:
name: Build Stats
path: reports/build-stats.html
retention-days: ${{ env.BRANCH_NAME == 'main' && 30 || 7 }}
- name: Expose sourcemaps
if: ${{ env.BRANCH_NAME == 'main' }}
uses: actions/upload-artifact@v3
with:
name: Sourcemaps
path: |
dist/**/*.map
if-no-files-found: ignore
retention-days: 30
publish:
name: Publish
needs: build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v3
- name: Restore Build
uses: actions/cache@v3
with:
path: dist
key: ${{ github.sha }}-${{ github.run_number }}
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
id: cfp
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: navigo-app
directory: dist
- run: |
echo "" >> $GITHUB_STEP_SUMMARY
echo "Deployed to ${{ steps.cfp.outputs.environment }} environment" >> $GITHUB_STEP_SUMMARY