From 0090d285da03f844f972091002e1ccc446fd7ce7 Mon Sep 17 00:00:00 2001 From: 3TUSK Date: Sat, 17 Oct 2020 23:28:19 -0700 Subject: [PATCH 1/2] meta(gitbook): github-action-based preview automation --- .github/workflows/preview.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/preview.yaml diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml new file mode 100644 index 00000000..a58e58d0 --- /dev/null +++ b/.github/workflows/preview.yaml @@ -0,0 +1,32 @@ +name: build-preview +on: + pull-request: + types: synchronize + branch: + - bleeding + paths-ignore: + - '.github/**' + - '.gitignore' + - 'LICENSE' +jobs: + preview: + name: 'Build Preview' + runs-on: ubuntu-18.04 + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + - name: Install GitBook CLI + run: npm install -g gitbook-cli + - name: Build Pages + run: gitbook install --log=warn && gitbook build --log=warn + - name: Upload Pages + env: + PR_NUMBER: ${{ github.event.number }} + AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET }} + run: aws --endpoint-url='https://eu-central-1.linodeobjects.com' s3 sync ./_book/ s3://preview.harbinger.covertdragon.team/$PR_NUMBER/ --acl public-read --delete --only-show-errors + - name: Ensure Website Config + env: + AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET }} + run: aws --endpoint-url='https://eu-central-1.linodeobjects.com' s3 website s3://preview.harbinger.covertdragon.team/ From d5b41a3c41c6e1a32943dc956a318c3ab062bc17 Mon Sep 17 00:00:00 2001 From: 3TUSK Date: Sat, 17 Oct 2020 23:46:53 -0700 Subject: [PATCH 2/2] meta(gitbook): specify index page --- .github/workflows/preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index a58e58d0..0940535f 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -29,4 +29,4 @@ jobs: env: AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS }} AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET }} - run: aws --endpoint-url='https://eu-central-1.linodeobjects.com' s3 website s3://preview.harbinger.covertdragon.team/ + run: aws --endpoint-url='https://eu-central-1.linodeobjects.com' s3 website s3://preview.harbinger.covertdragon.team/ --index-document index.html