Release book to S3 (#38)

This will automatically release the book to S3 after merging pull
requests
This commit is contained in:
Hendrik Kleinwaechter
2023-01-12 15:49:47 +01:00
committed by GitHub
parent 7ba8510da1
commit 8617acc687
3 changed files with 21 additions and 22 deletions

View File

@@ -1,22 +1,27 @@
name: Release LaTeX Document name: Release LaTeX Document
on: on:
push: push:
tags: branches:
- 'v*' - main
jobs: jobs:
build_latex: build_and_release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set up Git repository - name: Set up git repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- uses: xu-cheng/texlive-action/full@v1 - name: Build the book
uses: xu-cheng/texlive-action/full@v1
with: with:
run: | run: |
apk add make apk add make
cd book cd book
make all make all
make release make release
- name: Release - name: Release book on S3
uses: softprops/action-gh-release@v1 uses: shallwefootball/s3-upload-action@master
with: 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

View File

@@ -1,23 +1,15 @@
name: Validate LaTeX Document name: Validate LaTeX Document
on: on: [ push ]
pull_request:
branches:
- main
jobs: jobs:
build_latex: test_building_book:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set up Git repository - name: Set up git repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Build book - name: Test building book
uses: xu-cheng/texlive-action/full@v1 uses: xu-cheng/texlive-action/full@v1
with: with:
run: | run: |
apk add make apk add make
cd book cd book
make all make all
- name: Upload PDF
uses: actions/upload-artifact@v3
with:
name: PDF
path: book/book.pdf

View File

@@ -18,4 +18,6 @@ clean:
rm book.log rm book.log
release: release:
cp book.pdf TheBreadCode-The-Sourdough-Framework.pdf rm -rf release
mkdir release
cp book.pdf release/TheBreadCode-The-Sourdough-Framework.pdf