Skip to content

Created a configuration example #bruce #time 45m #1481

Created a configuration example #bruce #time 45m

Created a configuration example #bruce #time 45m #1481

Workflow file for this run

on:
push:
branches:
- main
paths-ignore:
- examples
- docs
- mkdocs.yml
jobs:
gen-and-preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.API_TOKEN_GITHUB }}
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'sbt'
# by default the examples submodule is detached
# so get it's main
- run: |
cd examples
rm -rf src/main/scala/Chapter*.scala
rm -rf src/test/scala/Chapter*.scala
git checkout main
cd ..
- run: |
./sbt test
- name: Update Examples
run: |
cd examples
git config --global user.name 'James Ward'
git config --global user.email '[email protected]'
git add .
git commit -m "updated examples"
git push
cd ..
git add examples
git commit -m "updated examples"
git push
- uses: test-room-7/action-update-file@v1
with:
file-path: |
manuscript/*
manuscript/resources/images/*
branch: publish
commit-msg: Update manuscript
github-token: ${{ secrets.GITHUB_TOKEN }}
- id: preview
if: ${{ github.ref == 'refs/heads/main' }}
uses: jamesward/leanpub-actions/preview@main
with:
apikey: ${{ secrets.LEANPUB_APIKEY }}
slug: effect-oriented-programming
- id: slack-notify
if: ${{ github.ref == 'refs/heads/main' }}
run: |
curl -s -X POST -H 'Content-type: application/json' --data "{\"text\":\"Book Preview: ${{ steps.preview.outputs.pdf_url }} ${{ steps.preview.outputs.epub_url }}\"}" ${{ secrets.SLACK_WEBHOOK }}