feat: Add factory methods #28
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: CD | |
on: | |
push: | |
branches: [master] | |
concurrency: | |
group: deploy | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build | |
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 | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
cache: npm | |
node-version-file: .node-version | |
- name: Install Node modules | |
run: npm install | |
- 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 | |
release: | |
name: Release | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ${{ needs.build.outputs.artifact-name }} | |
path: ${{ needs.build.outputs.artifact-path }} | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
cache: npm | |
node-version-file: .node-version | |
- name: Install Node modules | |
run: npm install | |
- name: Create release | |
env: | |
GIT_AUTHOR_NAME: github-actions[bot] | |
GIT_AUTHOR_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com | |
GIT_COMMITTER_NAME: github-actions[bot] | |
GIT_COMMITTER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_AUTH }} | |
run: npx semantic-release | |
notify: | |
name: Notify | |
needs: [build, deploy, release] | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: andrewscwei/telegram-action@v1 | |
with: | |
success: ${{ needs.build.result == 'success' && needs.deploy.result == 'success' && needs.release.result == 'success' }} | |
cancelled: ${{ needs.build.result == 'cancelled' || needs.deploy.result == 'cancelled' || needs.release.result == 'cancelled' }} | |
bot-token: ${{ secrets.TELEGRAM_DEVOPS_BOT_TOKEN }} | |
chat-id: ${{ secrets.TELEGRAM_DEVOPS_CHAT_ID }} |