From a87e8c55fc729c811f2bbc633ca28e21a5df87cc Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Fri, 6 Mar 2020 10:54:07 +1100 Subject: [PATCH] Add a GitHub action to publish The Book (#877) --- .github/workflows/book.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/book.yml diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml new file mode 100644 index 000000000..a78e8a2ef --- /dev/null +++ b/.github/workflows/book.yml @@ -0,0 +1,30 @@ +name: mdbook + +on: + push: + branches: + - master + +jobs: + build-and-upload-to-s3: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@master + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: '0.3.5' + + - run: mdbook build + working-directory: book + + - uses: jakejarvis/s3-sync-action@be0c4ab89158cac4278689ebedd8407dd5f35a83 + with: + args: --follow-symlinks --delete + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BOOK_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'ap-southeast-2' + SOURCE_DIR: 'book/book'