Skip to content

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

wip: migration from Travis CI to GitHub Actions #149

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

Workflow file for this run

name: Build & Deploy
on: [push]
jobs:
app:
runs-on: ubuntu-latest
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
TOKEN_GITHUB: ${{ secrets.TOKEN_GITHUB }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ secrets.NODE_VERSION }}
- name: Build & deploy
run: |
if [[ $COMMIT_MESSAGE !~ /(skip[ _-]app)/ ]]; then
chmod +x ./.github/workflows/app.sh
./.github/workflows/app.sh
fi
doc:
if: ${{ contains(github.event.head_commit.message, '[build doc]')}}
runs-on: ubuntu-latest
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
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
if: ${{ always() }}
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 == 'failed' || needs.doc.reult == 'failed') && 'danger' || 'good' }}
SLACK_MESSAGE: Build of ${{ github.repository }}@${{ github.ref_name }} by ${{ github.actor }} ${{ (needs.app.reult == 'failed' || needs.doc.reult == 'failed') && 'failed' || 'passed' }}
SLACK_FOOTER: