wip: migration from Travis CI to GitHub Actions #149 [build doc] #11
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: Build & Deploy | |
on: [push] | |
jobs: | |
app: | |
if: ${{ !contains(github.event.head_commit.message, '[skip app]') }} | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ secrets.NODE_VERSION }} | |
- name: Build and deploy | |
id: build-deploy | |
run: | | |
chmod +x ./.github/workflows/app.sh | |
./.github/workflows/app.sh | |
- name: Notify on slack | |
if: always() | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_APPS }} | |
SLACK_USERNAME: GitHub Actions | |
SLACK_ICON: https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png | |
SLACK_COLOR: ${{ steps.build-deploy.outcome == 'success' && 'good' || 'danger' }} | |
SLACK_MESSAGE: Build of ${{ github.repository }}@${{ github.ref_name }} by ${{ github.actor }} ${{ steps.build-deploy.outcome == 'success' && 'passed' || 'failed' }} | |
SLACK_FOOTER: | |
doc: | |
if: ${{ contains(github.event.head_commit.message, '[build doc]') }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ secrets.NODE_VERSION }} | |
- name: Build doc | |
run: | | |
chmod +x ./.github/workflows/doc.sh | |
./.github/workflows/doc.sh | |
- name: Deploy doc to GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages | |
FOLDER: docs/.vitepress/dist |