release(18.1.3): release 18.1.3 #41
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: | |
pull_request: | |
branches-ignore: | |
- gh-pages | |
push: | |
branches: [main, master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Comment on github | |
if: github.event.number | |
run: node ./scripts/_ci/github-comment.js "RELEASE" "[Using release @yelon, Preview Preparing...](https://github.com/hbyunzai/ng-yunzai/actions/runs/${{ github.run_id }})" | |
env: | |
ACCESS_REPO: ${{ github.repository }} | |
ACCESS_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
PR_NUMBER: ${{ github.event.number }} | |
- name: Install node modules | |
run: yarn install | |
- name: Build | |
run: ./scripts/_ci/deploy-pipelines.sh | |
- name: 'Deploy Site' | |
if: github.event.number | |
run: | | |
export DEPLOY_DOMAIN=https://preview-${{ github.event.number }}-ng-yunzai.surge.sh | |
echo "Deploy to $DEPLOY_DOMAIN" | |
cp ./dist/browser/index.html ./dist/browser/404.html | |
npx surge --project ./dist/browser --domain $DEPLOY_DOMAIN | |
env: | |
ACCESS_REPO: ${{ github.repository }} | |
ACCESS_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} | |
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} | |
- name: 'Update comment on github' | |
if: github.event.number | |
run: | | |
export DEPLOY_DOMAIN=https://preview-${{ github.event.number }}-ng-yunzai.surge.sh | |
node ./scripts/_ci/github-comment.js "RELEASE" "[Preview is ready!]($DEPLOY_DOMAIN)" | |
env: | |
ACCESS_REPO: ${{ github.repository }} | |
ACCESS_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
PR_NUMBER: ${{ github.event.number }} | |
- name: 'When failed' | |
if: github.event.number && failure() | |
run: node ./scripts/_ci/github-comment.js "RELEASE" "[Using release @yelon, Preview Failed](https://github.com/hbyunzai/ng-yunzai/actions/runs/${{ github.run_id }})" | |
env: | |
ACCESS_REPO: ${{ github.repository }} | |
ACCESS_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
PR_NUMBER: ${{ github.event.number }} | |
build-day: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Comment on github | |
if: github.event.number | |
run: node ./scripts/_ci/github-comment.js "RELEASE_DAY" "[Using day release @yelon, Preview Preparing...](https://github.com/hbyunzai/ng-yunzai/actions/runs/${{ github.run_id }})" | |
env: | |
ACCESS_REPO: ${{ github.repository }} | |
ACCESS_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
PR_NUMBER: ${{ github.event.number }} | |
- name: Install node modules | |
run: yarn install | |
- name: Build | |
run: ./scripts/_ci/deploy-pipelines.sh -day | |
- name: 'Deploy Site' | |
if: github.event.number | |
run: | | |
export DEPLOY_DOMAIN=https://preview-${{ github.event.number }}-day-ng-yunzai.surge.sh | |
echo "Deploy to $DEPLOY_DOMAIN" | |
cp ./dist/browser/index.html ./dist/browser/404.html | |
npx surge --project ./dist/browser --domain $DEPLOY_DOMAIN | |
env: | |
ACCESS_REPO: ${{ github.repository }} | |
ACCESS_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} | |
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} | |
- name: 'Update comment on github' | |
if: github.event.number | |
run: | | |
export DEPLOY_DOMAIN=https://preview-${{ github.event.number }}-day-ng-yunzai.surge.sh | |
node ./scripts/_ci/github-comment.js "RELEASE_DAY" "[Using day release @yelon, Preview is ready!]($DEPLOY_DOMAIN)" | |
env: | |
ACCESS_REPO: ${{ github.repository }} | |
ACCESS_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
PR_NUMBER: ${{ github.event.number }} | |
- name: 'When failed' | |
if: github.event.number && failure() | |
run: node ./scripts/_ci/github-comment.js "RELEASE" "[Using day release @yelon, Preview Failed](https://github.com/hbyunzai/ng-yunzai/actions/runs/${{ github.run_id }})" | |
env: | |
ACCESS_REPO: ${{ github.repository }} | |
ACCESS_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
PR_NUMBER: ${{ github.event.number }} | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install node modules | |
run: yarn install | |
- name: Check code lint | |
run: yarn run lint | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install node modules | |
run: yarn install | |
- name: Check code lint | |
run: npx ng test --no-progress --browsers=ChromeHeadless --code-coverage --no-watch |