This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
Merge branch 'main' of https://github.com/starknet-edu/starknetbook #179
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 mdBook to Production Site | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: read | |
id-token: write | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read # To push a branch | |
id-token: write # To update the deployment status | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup Rust cache | |
uses: ./.github/workflows/setup-rust-cache | |
- name: Install mdbook | |
uses: ./.github/workflows/install-mdbook | |
- name: Build in English | |
run: | | |
mdbook build -d book | |
- name: Build all translations | |
run: | | |
for po_lang in $(cat ./LANGUAGES); do | |
echo "::group::Building $po_lang translation" | |
MDBOOK_BOOK__LANGUAGE=$po_lang \ | |
mdbook build -d book/$po_lang | |
echo "::endgroup::" | |
done | |
- name: Rename book to public_html | |
run: mv book public_html | |
- name: scp upload to production site | |
run: | | |
sshpass -p ${{ secrets.PROD_PASS }} scp -o 'StrictHostKeyChecking no' -r public_html/ ${{ secrets.PROD_USER }}@${{ secrets.PROD_IP }}:~/ |