diff --git a/.gitea/workflows/build-serve.yml b/.gitea/workflows/build-serve.yml index 2dcaf3c..d369d99 100644 --- a/.gitea/workflows/build-serve.yml +++ b/.gitea/workflows/build-serve.yml @@ -1,29 +1,30 @@ -name: Build mdBook +name: github pages on: push: branches: - main + pull_request: jobs: - build: - runs-on: ubuntu-latest - + deploy: + runs-on: ubuntu-20.04 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} steps: - - name: Checkout code - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - - name: Install mdBook - run: | - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xvz -C /usr/local/bin + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v2 + with: + mdbook-version: '0.4.10' + # mdbook-version: 'latest' - - name: Build mdBook - run: mdbook build + - run: mdbook build - name: Deploy - run: | - rsync -avz --delete ./book/ books@signorovitch.org:apush-guide - env: - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - - + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/main' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./book