diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 7ce25c51eb5..3fc3ae5f5d0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -24,19 +24,23 @@ jobs: name: Build (and deploy) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.1.0 + - uses: actions/checkout@v4 with: fetch-depth: 0 # this step uses the `.ruby-version` file - uses: ruby/setup-ruby@v1 + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + - name: Build Jekyll Site run: | bundle install bundle exec jekyll build - - uses: aws-actions/configure-aws-credentials@v1-node16 + - uses: aws-actions/configure-aws-credentials@4 with: role-to-assume: ${{ vars.AWS_ROLE_ARN }} aws-region: ${{ vars.AWS_REGION }} @@ -48,7 +52,7 @@ jobs: - name: Post-process docs run: ci/post-process.sh - - name: Deploy site + - name: Deploy site to Netlify env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_API_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_DOCS_SITE_ID }} @@ -63,3 +67,19 @@ jobs: fi netlify deploy "$ARGS" \ --dir=_site + + - name: Deploy site to Vercel + env: + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} + run: | + npm install + npm install --global --force vercel + + ARGS="" + if [ "$GITHUB_REF_NAME" = "main" ]; then + ARGS="--prod" + fi + ./vercel.sh mk-dist + vercel deploy --prebuilt "${ARGS}" --token="${VERCEL_TOKEN}" diff --git a/.gitignore b/.gitignore index ba4669724f5..7b58c17bbe8 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ lib_map.json .netlify __pycache__/ node_modules +.vercel diff --git a/_config.yml b/_config.yml index f5c8462b40a..ac97d04fce1 100644 --- a/_config.yml +++ b/_config.yml @@ -14,6 +14,12 @@ exclude: - release_checklist.md - ci/ - node_modules/ + - package.json + - package-lock.json + - vercel.sh + - vercel.json + - Gemfile + - Gemfile.lock include: - _sources - _static diff --git a/vercel.sh b/vercel.sh index fc78929c10c..a8f61617c20 100755 --- a/vercel.sh +++ b/vercel.sh @@ -26,10 +26,15 @@ build() { env | sort echo "clean output directories..." - rm -rf ./.vercel/output ./_site + rm -rf ./.vercel/ ./_site echo "building..." jekyll build + mk-dist +} + +mk-dist() { + echo "copying to vercel directory..." mkdir -p .vercel/output/ node ci/vercel/config.mjs > .vercel/output/config.json cp -r _site .vercel/output/static @@ -42,6 +47,9 @@ case "${CMD}" in "build") build ;; + "mk-dist") + mk-dist + ;; *) echo "${USAGE}" exit 1