From 8617acc687b94b324343e9847aaebaa368e42ab0 Mon Sep 17 00:00:00 2001 From: Hendrik Kleinwaechter Date: Thu, 12 Jan 2023 15:49:47 +0100 Subject: [PATCH] Release book to S3 (#38) This will automatically release the book to S3 after merging pull requests --- .github/workflows/main.yml | 21 +++++++++++++-------- .github/workflows/validate.yml | 18 +++++------------- book/makefile | 4 +++- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 708e7b1..b6e7ff4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,22 +1,27 @@ name: Release LaTeX Document on: push: - tags: - - 'v*' + branches: + - main jobs: - build_latex: + build_and_release: runs-on: ubuntu-latest steps: - - name: Set up Git repository + - name: Set up git repository uses: actions/checkout@v3 - - uses: xu-cheng/texlive-action/full@v1 + - name: Build the book + uses: xu-cheng/texlive-action/full@v1 with: run: | apk add make cd book make all make release - - name: Release - uses: softprops/action-gh-release@v1 + - name: Release book on S3 + uses: shallwefootball/s3-upload-action@master with: - files: book/TheBreadCode-The-Sourdough-Framework.pdf + aws_key_id: ${{ secrets.AWS_KEY_ID }} + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} + aws_bucket: ${{ secrets.AWS_BUCKET }} + source_dir: book/release + destination_dir: release \ No newline at end of file diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 9f86fe4..ea1bce9 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,23 +1,15 @@ name: Validate LaTeX Document -on: - pull_request: - branches: - - main +on: [ push ] jobs: - build_latex: + test_building_book: runs-on: ubuntu-latest steps: - - name: Set up Git repository + - name: Set up git repository uses: actions/checkout@v3 - - name: Build book + - name: Test building book uses: xu-cheng/texlive-action/full@v1 with: run: | apk add make cd book - make all - - name: Upload PDF - uses: actions/upload-artifact@v3 - with: - name: PDF - path: book/book.pdf + make all \ No newline at end of file diff --git a/book/makefile b/book/makefile index 62d374d..52ddaa4 100644 --- a/book/makefile +++ b/book/makefile @@ -18,4 +18,6 @@ clean: rm book.log release: - cp book.pdf TheBreadCode-The-Sourdough-Framework.pdf + rm -rf release + mkdir release + cp book.pdf release/TheBreadCode-The-Sourdough-Framework.pdf