x #15
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: CI | |
on: | |
push: | |
branches: main | |
pull_request: | |
branches: main | |
env: | |
CARGO_TERM_COLOR: always | |
GITHUB_ACTION_RUN_ID: ${{ github.run_id }} | |
GITHUB_ACTION_RUN_NUMBER: ${{ github.run_number }} | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@1.80.0 | |
with: | |
components: rustfmt, clippy | |
- name: Cargo cache | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} | |
path: ~/.cargo/registry | |
- name: install MoonBit | |
run: | | |
curl -fsSLv https://cli.moonbitlang.com/install/unix.sh | bash -s | |
echo "$HOME/.moon/bin" >> $GITHUB_PATH | |
- name: Version | |
run: moon version --all | |
- name: Build | |
run: | | |
cargo build --release | |
./target/release/moon_dashboard --file repos.txt | |
- name: Commit | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add ./webapp/public/data.jsonl | |
git commit -m "Update data.jsonl" || echo "No changes to commit" | |
- name: Push changes | |
run: git push | |
- name: Setup Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'pnpm' | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: pnpm install | |
run: pnpm install | |
working-directory: ./webapp | |
- name: pnpm run build | |
run: pnpm run build | |
working-directory: ./webapp | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: ./webapp/dist | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
force_orphan: true |