Skip to content

Commit

Permalink
ci: add build and deployment of documentation website
Browse files Browse the repository at this point in the history
  • Loading branch information
tassiluca committed Feb 20, 2024
1 parent 7569bbf commit 63a254f
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 361 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build-test-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- 'LICENSE'
- 'README.md'
- 'renovate.json'
- 'docs/**'
pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -38,8 +39,12 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check
run: ./gradlew check
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: ./gradlew classes testClasses
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

success:
needs: build
Expand Down
71 changes: 40 additions & 31 deletions .github/workflows/publish-doc.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,55 @@
name: Publish on GH Pages the documentation

name: Build and deploy
on:
push:
paths:
- "docs/**"
- 'docs/**'
- '.github/workflows/publish-doc.yaml'
pull_request:
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
contents: write
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
Build-Documentation-Site:
runs-on: ubuntu-latest
concurrency:
group: slides-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
uses: danysk/action-checkout@0.2.14
- name: Compute the version of Hugo
id: hugo
shell: bash
run: |
USES=$(cat <<TRICK_RENOVATE
- uses: gohugoio/hugo@v0.123.0
TRICK_RENOVATE
)
echo "Scripts update line: \"$USES\""
echo "Computed version: \"${USES#*@v}\""
echo "version=${USES#*@v}" >> "$GITHUB_OUTPUT"
- name: Download Hugo
run: |
HUGO_VERSION="${{ steps.hugo.outputs.version }}"
URL="https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb"
wget --retry-connrefused --waitretry=1 --read-timeout=20 "$URL" --output-document=hugo.deb
- name: Install Hugo
run: sudo dpkg -i hugo.deb
- name: Remove Hugo Installer
run: rm hugo.deb
- name: Build slides with hugo
run: |
cd docs
hugo
- name: Deployment
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
source: docs
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

publish:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: docs
publish_dir: ./docs/public
11 changes: 0 additions & 11 deletions README.md

This file was deleted.

24 changes: 0 additions & 24 deletions back-and-forth/src/main/scala/io/github/tassiLuca/Launcher.scala

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

53 changes: 0 additions & 53 deletions back-and-forth/src/main/scala/io/github/tassiLuca/core/Space.scala

This file was deleted.

This file was deleted.

Loading

0 comments on commit 63a254f

Please sign in to comment.