update github actions #6
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: Deploy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
CI_COMMIT_MESSAGE: Continuous Integration Build Artifacts | ||
CI_COMMIT_AUTHOR: Continuous Integration | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install latest mdbook | ||
run: | | ||
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name') | ||
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz" | ||
mkdir mdbook | ||
curl -sSL $url | tar -xz --directory=./mdbook | ||
echo `pwd`/mdbook >> $GITHUB_PATH | ||
- name: Build Book | ||
run: | | ||
cd src/powerjoular/ | ||
mdbook build | ||
cd ../joularjx/ | ||
mdbook build | ||
- name : Copy build book | ||
run: | | ||
cd src/powerjoular/book/ | ||
cp -rf ./* docs/powerjoular | ||
cd ../../.. | ||
cd src/joularjx/book/ | ||
cp -rf ./* docs/joularjx | ||
- name: GIT Commit Build Artifacts | ||
if: github.event_name == 'push' | ||
run: | | ||
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" | ||
git config --global user.email "[email protected]" | ||
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}" | ||
git push |