diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 0000000..4b368b6 --- /dev/null +++ b/.github/workflows/cd.yaml @@ -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 }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0826355 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 }}