Skip to content

Commit

Permalink
ci: Add CI/CD workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewscwei committed Sep 19, 2024
1 parent 25b5422 commit 6cf4aa0
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CD
on:
push:
branches: [master]
tags-ignore: ['v*']
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
uses: andrewscwei/actions/node-build@v2
- name: Test
run: npm test
- name: Deploy to GitHub pages
uses: andrewscwei/actions/gh-pages-deploy@v2
with:
deploy-path: build
notify:
name: Notify
needs: [deploy]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- uses: andrewscwei/telegram-action@v1
with:
success: ${{ needs.deploy.result == 'success' }}
cancelled: ${{ needs.deploy.result == 'cancelled' }}
bot-token: ${{ secrets.TELEGRAM_DEVOPS_BOT_TOKEN }}
chat-id: ${{ secrets.TELEGRAM_DEVOPS_CHAT_ID }}
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI
on:
push:
branches-ignore: [master]
tags-ignore: ['v*']
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
uses: andrewscwei/actions/node-build@v2
notify:
name: Notify
needs: [build]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- uses: andrewscwei/telegram-action@v1
with:
success: ${{ needs.build.result == 'success' }}
cancelled: ${{ needs.build.result == 'cancelled' }}
bot-token: ${{ secrets.TELEGRAM_DEVOPS_BOT_TOKEN }}
chat-id: ${{ secrets.TELEGRAM_DEVOPS_CHAT_ID }}

0 comments on commit 6cf4aa0

Please sign in to comment.