fix: 移除构建文档时不需要的 actions #9
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: CI | |
on: | |
push: | |
branches: | |
- main | |
- '[0-9]+.[0-9]+.x' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: {} | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
aio: | |
runs-on: ubuntu-latest-4core | |
steps: | |
- name: Initialize environment | |
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@c83e99a12397014162531ca125c94549db55dd84 | |
with: | |
cache-node-modules: true | |
node-module-directories: | | |
./aio/node_modules | |
- name: Setup Bazel | |
uses: angular/dev-infra/github-actions/bazel/setup@c83e99a12397014162531ca125c94549db55dd84 | |
- name: Setup Bazel RBE | |
uses: angular/dev-infra/github-actions/bazel/configure-remote@c83e99a12397014162531ca125c94549db55dd84 | |
- name: Install node modules for aio | |
run: yarn install --cwd aio --frozen-lockfile | |
- name: Run AIO tests with upstream packages | |
run: yarn --cwd aio test:ci | |
- name: Check generated bundle sizes | |
run: yarn --cwd aio payload-size | |
aio-local: | |
runs-on: | |
labels: ubuntu-latest-4core | |
steps: | |
- name: Initialize environment | |
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@c83e99a12397014162531ca125c94549db55dd84 | |
with: | |
cache-node-modules: true | |
node-module-directories: | | |
./aio/node_modules | |
- name: Setup Bazel | |
uses: angular/dev-infra/github-actions/bazel/setup@c83e99a12397014162531ca125c94549db55dd84 | |
- name: Setup Bazel RBE | |
uses: angular/dev-infra/github-actions/bazel/configure-remote@c83e99a12397014162531ca125c94549db55dd84 | |
- name: Install node modules | |
run: yarn install --cwd aio --frozen-lockfile | |
- name: Run AIO tests with local packages | |
run: yarn --cwd aio test-local:ci | |
- name: Check generated bundle sizes | |
run: yarn --cwd aio payload-size aio-local | |
aio-deploy: | |
needs: [aio] | |
if: needs.aio.result == 'success' && github.event_name == 'push' | |
runs-on: | |
labels: ubuntu-latest | |
steps: | |
- name: Initialize environment | |
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@c83e99a12397014162531ca125c94549db55dd84 | |
with: | |
cache-node-modules: true | |
node-module-directories: | | |
./aio/node_modules | |
- name: Setup Bazel | |
uses: angular/dev-infra/github-actions/bazel/setup@c83e99a12397014162531ca125c94549db55dd84 | |
- name: Setup Bazel RBE | |
uses: angular/dev-infra/github-actions/bazel/configure-remote@c83e99a12397014162531ca125c94549db55dd84 | |
- name: Install node modules for aio | |
run: yarn install --cwd aio --frozen-lockfile | |
- name: Set the stable branch environment variable | |
id: latest_version | |
run: | | |
echo "CI_STABLE_BRANCH=$(npm info @angular/core dist-tags.latest | sed -r 's/^\s*([0-9]+\.[0-9]+)\.[0-9]+.*$/\1.x/')" >> $GITHUB_OUTPUT | |
echo "CI_BRANCH=$(echo ${{ github.event.ref }} | cut -d '/' -f 3)" >> $GITHUB_OUTPUT | |
- name: Deploy aio to production | |
env: | |
CI_AIO_MIN_PWA_SCORE: '95' | |
CI_COMMIT: ${{ github.event.after }} | |
CI_REPO_NAME: 'angular' | |
CI_PULL_REQUEST: 'false' | |
CI_REPO_OWNER: 'angular' | |
CI_BUILD_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' | |
CI_STABLE_BRANCH: ${{ steps.latest_version.outputs.CI_STABLE_BRANCH }} | |
CI_BRANCH: ${{ steps.latest_version.outputs.CI_BRANCH }} | |
CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN: ${{ secrets.AIO_DEPLOY_TOKEN }} | |
CI_SECRET_PAYLOAD_FIREBASE_TOKEN: ${{ secrets.AIO_PAYLOAD_TOKEN }} | |
run: yarn --cwd aio deploy-production |