Skip to content

Commit

Permalink
ci: Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewscwei committed May 30, 2024
1 parent 9704d78 commit 2f2b861
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 25 deletions.
60 changes: 37 additions & 23 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down

0 comments on commit 2f2b861

Please sign in to comment.