2021-07-27 21:52:49 +02:00
|
|
|
name: Verdaccio Website CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2022-11-12 08:42:01 +02:00
|
|
|
permissions:
|
|
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
|
2024-08-06 19:31:37 +02:00
|
|
|
concurrency:
|
|
|
|
group: website-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-07-27 21:52:49 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
2022-11-12 08:42:01 +02:00
|
|
|
permissions:
|
|
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
deployments: write
|
|
|
|
pull-requests: write # to comment on pull-requests
|
|
|
|
|
2021-07-27 21:52:49 +02:00
|
|
|
runs-on: ubuntu-latest
|
2024-04-28 11:52:38 +02:00
|
|
|
if: github.repository == 'verdaccio/verdaccio'
|
2023-11-29 20:08:23 +01:00
|
|
|
name: setup verdaccio
|
|
|
|
services:
|
|
|
|
verdaccio:
|
2024-10-20 19:26:36 +02:00
|
|
|
image: verdaccio/verdaccio:6
|
2023-11-29 20:08:23 +01:00
|
|
|
ports:
|
|
|
|
- 4873:4873
|
|
|
|
env:
|
2024-08-06 19:31:37 +02:00
|
|
|
NODE_ENV: production
|
2021-07-27 23:30:02 +02:00
|
|
|
env:
|
|
|
|
NODE_OPTIONS: --max_old_space_size=4096
|
2021-07-27 21:52:49 +02:00
|
|
|
steps:
|
2024-11-02 10:02:18 +01:00
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
2024-11-28 10:53:05 +01:00
|
|
|
- name: Build application with Node 20
|
|
|
|
uses: ./.github/actions/build-app
|
2023-11-29 20:02:58 +01:00
|
|
|
with:
|
2024-11-28 10:53:05 +01:00
|
|
|
node-version: 20
|
2022-10-01 14:08:40 +02:00
|
|
|
- name: Build Translations percentage
|
2023-04-12 17:55:39 +02:00
|
|
|
run: pnpm --filter @verdaccio/crowdin-translations build
|
2021-07-27 21:52:49 +02:00
|
|
|
- name: Cache Docusaurus Build
|
2024-11-02 12:01:14 +01:00
|
|
|
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.0.2
|
2021-07-27 21:52:49 +02:00
|
|
|
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
|
2024-03-03 13:49:00 +01:00
|
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
2021-07-27 21:52:49 +02:00
|
|
|
env:
|
2021-07-27 22:39:24 +02:00
|
|
|
CROWDIN_VERDACCIO_API_KEY: ${{ secrets.CROWDIN_VERDACCIO_API_KEY }}
|
2022-10-01 14:08:40 +02:00
|
|
|
SENTRY_KEY: ${{ secrets.SENTRY_KEY }}
|
2021-07-27 21:52:49 +02:00
|
|
|
CONTEXT: production
|
2024-03-03 13:49:00 +01:00
|
|
|
run: pnpm --filter @verdaccio/website netlify:build
|
|
|
|
- name: Deploy to Netlify
|
2024-05-05 16:53:28 +02:00
|
|
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'workflow_dispatch'
|
2021-07-27 21:52:49 +02:00
|
|
|
env:
|
2024-03-03 13:49:00 +01:00
|
|
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
|
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
2024-08-06 19:31:37 +02:00
|
|
|
run: pnpm --filter ...@verdaccio/website netlify:deploy
|
2021-07-27 21:52:49 +02:00
|
|
|
|