Skip to content

wip: migration from Travis CI to GitHub Actions #149 #14

wip: migration from Travis CI to GitHub Actions #149

wip: migration from Travis CI to GitHub Actions #149 #14

Workflow file for this run

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 & deploy
run: |
chmod +x ./.github/workflows/app.sh
./.github/workflows/app.sh
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/github-pages-deploy-action@v4
with:
folder: docs/.vitepress/dist
slackNotification:
name: Notify on slack
runs-on: ubuntu-latest
needs: [app, doc]
steps:
- uses: actions/checkout@v4
- name: Notify on slack
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: ${{ (needs.app.reult == 'success' && needs.doc.reult == 'success') && 'good' || 'danger' }}
SLACK_MESSAGE: Build of ${{ github.repository }}@${{ github.ref_name }} by ${{ github.actor }} ${{ (needs.app.reult == 'success' && needs.doc.reult == 'success') && 'passed' || 'failed' }}
SLACK_FOOTER: