name: Preview on: pull_request: branches: [ main ] jobs: deploy: runs-on: ubuntu-latest env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps BUNDLE_GEMFILE: Gemfile steps: - uses: actions/checkout@v2 - name: Setup Ruby uses: ruby/setup-ruby@v1 with: ruby-version: 2.6 bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Build run: | bundle exec rake book:all - name: Copy run: | mkdir -p public mv README.html index.html cp *.html public cp *.pdf public - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} external_repository: loongson/LoongArch-Documentation-Preview publish_branch: gh-pages publish_dir: ./public - name: Update status uses: Sibz/github-status-action@v1 with: authToken: ${{ secrets.GITHUB_TOKEN }} context: 'LoongArch Documentation Preview / Deploy (update)' description: 'Deployed, click "Details" to view ->' state: 'success' target_url: https://loongson.github.io/LoongArch-Documentation-Preview sha: ${{github.event.pull_request.head.sha || github.sha}}