From 2f2b8612a1eed853fe62e285dd0fa4b1698a57d7 Mon Sep 17 00:00:00 2001 From: Andrew Wei Date: Thu, 30 May 2024 12:00:04 -0700 Subject: [PATCH] ci: Update CI --- .github/workflows/cd.yml | 60 +++++++++++++++++++++++++--------------- .github/workflows/ci.yml | 10 +++++-- 2 files changed, 45 insertions(+), 25 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index cdd003a..7e9293e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -7,36 +7,50 @@ on: jobs: build: name: Build - uses: andrewscwei/workflows/.github/workflows/node-build.yml@master - with: - artifacts-path: build/ - deploy-npm: - name: Deploy - uses: andrewscwei/workflows/.github/workflows/npm-deploy.yml@master - needs: [build] - with: - artifacts-name: ${{ needs.build.outputs.artifacts-name }} - artifacts-path: ${{ needs.build.outputs.artifacts-path }} - create-release: true - secrets: - npm-auth-token: ${{ secrets.NPM_AUTH }} - deploy-pages: + runs-on: ubuntu-latest + outputs: + artifact-name: ${{ steps.build.outputs.artifact-name }} + artifact-path: ${{ steps.build.outputs.artifact-path }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build + id: build + uses: andrewscwei/actions/node-build@v1 + with: + artifact-path: build/ + deploy: name: Deploy - uses: andrewscwei/workflows/.github/workflows/gh-pages-deploy.yml@master needs: [build] - with: - artifacts-name: ${{ needs.build.outputs.artifacts-name }} - artifacts-path: ${{ needs.build.outputs.artifacts-path }} - predeploy-command: npm run pages + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Deploy to NPM + uses: andrewscwei/actions/npm-deploy@v1 + with: + artifact-name: ${{ needs.build.outputs.artifact-name }} + artifact-path: ${{ needs.build.outputs.artifact-path }} + npm-auth-token: ${{ secrets.NPM_AUTH }} + - name: Deploy to GitHub pages + uses: andrewscwei/actions/gh-pages-deploy@v1 + with: + artifact-name: ${{ needs.build.outputs.artifact-name }} + artifact-path: ${{ needs.build.outputs.artifact-path }} + predeploy-command: npm run pages + - name: Release + uses: andrewscwei/actions/release@v1 + with: + version: ${{ github.ref }} notify: name: Notify - needs: [build, deploy-npm, deploy-pages] + needs: [build, deploy] if: ${{ always() }} runs-on: ubuntu-latest steps: - - uses: andrewscwei/telegram-action@v1.0.0 + - uses: andrewscwei/telegram-action@v1 with: - success: ${{ needs.build.result == 'success' && needs.deploy-npm.result == 'success' && needs.deploy-pages.result == 'success' }} - cancelled: ${{ needs.build.result == 'cancelled' || needs.deploy-npm.result == 'cancelled' || needs.deploy-pages.result == 'cancelled' }} + success: ${{ needs.build.result == 'success' && needs.deploy.result == 'success' }} + cancelled: ${{ needs.build.result == 'cancelled' || needs.deploy.result == 'cancelled' }} bot-token: ${{ secrets.TELEGRAM_DEVOPS_BOT_TOKEN }} chat-id: ${{ secrets.TELEGRAM_DEVOPS_CHAT_ID }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90314cb..c00e046 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,14 +6,20 @@ on: jobs: build: name: Build - uses: andrewscwei/workflows/.github/workflows/node-build.yml@master + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build + id: build + uses: andrewscwei/actions/node-build@v1 notify: name: Notify needs: [build] if: ${{ always() }} runs-on: ubuntu-latest steps: - - uses: andrewscwei/telegram-action@v1.0.0 + - uses: andrewscwei/telegram-action@v1 with: success: ${{ needs.build.result == 'success' }} cancelled: ${{ needs.build.result == 'cancelled' }}