Skip to content

Commit

Permalink
ci: Move website deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Nov 24, 2023
1 parent 0e53605 commit fce21f8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/documentation-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,33 @@ on:

jobs:
deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: write
pages: write
contents: read
id-token: write

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4
with:
python-version: 3.x

- name: Install mkdocs-material
run: |
pip install mkdocs-material
pip install blockdiag-fences
pip install mkdocs-git-revision-date-localized-plugin
- name: Build/deploy documentation
run: pip install mkdocs-material

- name: Build documentation
run: |
cd packages/documentation
mkdocs gh-deploy --force
.scripts/build.sh
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
with:
aws-region: eu-west-1
role-to-assume: arn:aws:iam::022327457572:role/kitten-science-website-maintainer
role-session-name: GitHubActions

- name: Deploy to S3
run: |
aws s3 sync ./packages/documentation/public/ s3://kitten-science-website/ \
--cache-control "public, s-maxage=3600, maxage=3600"
7 changes: 2 additions & 5 deletions packages/documentation/.scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ fi
cd "$(dirname "$0")"

main() {
cd ..
podman build -t squidfunk/mkdocs-material .

cd ../..
podman run --rm -it -v "${PWD}":/docs squidfunk/mkdocs-material build --config-file packages/documentation/mkdocs.yml --site-dir public
cd ../../..
podman run --rm -v "${PWD}":/docs docker.io/squidfunk/mkdocs-material build --config-file packages/documentation/mkdocs.yml --site-dir public
}

main "$@"
7 changes: 2 additions & 5 deletions packages/documentation/.scripts/serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ fi
cd "$(dirname "$0")"

main() {
cd ..
podman build -t squidfunk/mkdocs-material .

cd ../..
podman run --rm -it -p 8000:8000 -v "${PWD}":/docs squidfunk/mkdocs-material serve --config-file packages/documentation/mkdocs.yml
cd ../../..
podman run --rm -p 8000:8000 -v "${PWD}":/docs docker.io/squidfunk/mkdocs-material serve --config-file packages/documentation/mkdocs.yml
}

main "$@"
2 changes: 0 additions & 2 deletions packages/documentation/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ markdown_extensions:
- toc:
permalink: true
plugins:
- git-revision-date-localized:
enable_creation_date: true
- search
repo_name: kitten-science/kitten-scientists
repo_url: https://github.com/kitten-science/kitten-scientists
Expand Down

0 comments on commit fce21f8

Please sign in to comment.