0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00
verdaccio/.github/workflows/website.yml

80 lines
2.6 KiB
YAML
Raw Normal View History

name: Verdaccio Website CI
on:
workflow_dispatch:
permissions:
contents: read # to fetch code (actions/checkout)
2024-08-06 12:31:37 -05:00
concurrency:
group: website-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
permissions:
contents: read # to fetch code (actions/checkout)
deployments: write
pull-requests: write # to comment on pull-requests
runs-on: ubuntu-latest
if: github.repository == 'verdaccio/verdaccio'
2023-11-29 14:08:23 -05:00
name: setup verdaccio
services:
verdaccio:
image: verdaccio/verdaccio:6
2023-11-29 14:08:23 -05:00
ports:
- 4873:4873
env:
2024-08-06 12:31:37 -05:00
NODE_ENV: production
env:
NODE_OPTIONS: --max_old_space_size=4096
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
2023-11-29 14:00:58 -05:00
- name: Node
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
2023-11-29 14:00:58 -05:00
node-version-file: '.nvmrc'
- name: Install pnpm
run: |
corepack enable
corepack install
2023-11-29 14:06:23 -05:00
- name: set store
run: |
mkdir ~/.pnpm-store
pnpm config set store-dir ~/.pnpm-store
2023-11-29 14:02:58 -05:00
- name: Install
run: pnpm install --registry http://localhost:4873
- name: Cache .pnpm-store
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v4.0.2
2023-11-29 14:02:58 -05:00
with:
path: ~/.pnpm-store
key: pnpm-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
2024-08-06 12:31:37 -05:00
pnpm-
- name: Build
run: pnpm build
- name: Build Translations percentage
2023-04-12 10:55:39 -05:00
run: pnpm --filter @verdaccio/crowdin-translations build
- name: Cache Docusaurus Build
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v4.0.2
with:
path: website/node_modules/.cache/webpack
key: cache/webpack-${{github.ref}}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: cache/webpack-${{github.ref}}
- name: Build Production
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
env:
CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }}
SENTRY_KEY: ${{ secrets.SENTRY_KEY }}
CONTEXT: production
run: pnpm --filter @verdaccio/website netlify:build
- name: Deploy to Netlify
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
2024-08-06 12:31:37 -05:00
run: pnpm --filter ...@verdaccio/website netlify:deploy