Skip to content

Merge pull request #9 from tirix/introspective #58

Merge pull request #9 from tirix/introspective

Merge pull request #9 from tirix/introspective #58

Workflow file for this run

name: Build and Deploy
on: [push, pull_request, workflow_dispatch]
permissions:
contents: write
jobs:
build:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get builder SHA
id: get-sha
run: |
echo "sha=$( curl -u "u:${{github.token}}" https://api.github.com/repos/tirix/metamath-blueprints-rs/git/ref/heads/master | jq .object.sha | tr -d '"' )" >> $GITHUB_OUTPUT
- name: Cache metamath-blueprints-rs
id: cache-metamath-blueprints-rs
uses: actions/cache@v4
env:
cache-name: cache-blueprints-rs
with:
path: .metamath-blueprints-rs/target/release/metamath-blueprints-rs
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ steps.get-sha.outputs.sha }}
- name: Install rust
if: ${{ !steps.cache-metamath-blueprints-rs.outputs.cache-hit }}
uses: hecrj/setup-rust-action@v2
with:
rust-version: stable
- name: Install metamath-blueprints-rs
if: ${{ !steps.cache-metamath-blueprints-rs.outputs.cache-hit }}
run: |
rm -rf .metamath-blueprints-rs &&
git clone --depth 1 https://github.com/tirix/metamath-blueprints-rs.git .metamath-blueprints-rs &&
cd .metamath-blueprints-rs &&
cargo build --release
- name: Build
run: |
.metamath-blueprints-rs/target/release/metamath-blueprints-rs build .
- name: Save build
uses: actions/upload-artifact@v4
with:
name: build
path: build
if-no-files-found: error
deploy:
needs: build
if: github.ref == 'refs/heads/master'
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Load build
uses: actions/download-artifact@master
with:
name: build
path: build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build