mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
ci(docs): docs are now also buing build on every push on main
ci: improved docker testing ci: updates ci: better documentation pipeline and docker tests
This commit is contained in:
parent
571704404f
commit
18f13285ec
58
.github/workflows/ci.yml
vendored
58
.github/workflows/ci.yml
vendored
@ -158,6 +158,9 @@ jobs:
|
|||||||
if: startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main')
|
if: startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
-
|
||||||
|
name: Install jq
|
||||||
|
run: apt-get update && apt-get install -y jq
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -196,15 +199,23 @@ jobs:
|
|||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
-
|
-
|
||||||
name: "Test docker image 'edge'"
|
name: Store built tags in env variable
|
||||||
if: github.ref == 'refs/heads/main'
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
docker run --rm --pull never solidproject/community-server:edge --version
|
echo 'generated_tags<<EOM' >> $GITHUB_ENV
|
||||||
|
echo '${{ toJSON(fromJSON(steps.meta.outputs.json).tags) }}' >> $GITHUB_ENV
|
||||||
|
echo 'EOM' >> $GITHUB_ENV
|
||||||
-
|
-
|
||||||
name: "Test docker image 'latest'"
|
name: "Test all docker-built image tags"
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
shell: bash
|
||||||
|
# Loop over all generated image:tag names and docker run them.
|
||||||
|
# If they aren't built previously, the command will error.
|
||||||
|
# If they don't work, the job will fail.
|
||||||
|
# If they work the --version argument should return a version. and the job succeeds.
|
||||||
run: |
|
run: |
|
||||||
docker run --rm --pull never solidproject/community-server:latest --version
|
jq -rc '.[]' <<< '${{env.generated_tags}}' | while read i; do
|
||||||
|
docker run --rm --pull never $i --version
|
||||||
|
done;
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
@ -292,10 +303,12 @@ jobs:
|
|||||||
path: docs
|
path: docs
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
mkdocs:
|
mkdocs-tag:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
# Only trigger on tagged release that doesn't have a prerelease qualifier (like -alpha, -beta, -rc)
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')
|
||||||
needs:
|
needs:
|
||||||
|
- docker-main-branch
|
||||||
- typedocs
|
- typedocs
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -309,11 +322,34 @@ jobs:
|
|||||||
- run: git config user.name ci-bot
|
- run: git config user.name ci-bot
|
||||||
- run: git config user.email ci-bot@example.com
|
- run: git config user.email ci-bot@example.com
|
||||||
- run: git fetch origin gh-pages --depth=1
|
- run: git fetch origin gh-pages --depth=1
|
||||||
- run: cd documentation && mike deploy --push --update-aliases ${{steps.get_version.outputs.major}}.${{steps.get_version.outputs.minor}} latest
|
- run: cd documentation && mike deploy --push --update-aliases ${{steps.get_version.outputs.major}}.x latest
|
||||||
|
|
||||||
|
mkdocs-latest:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Runs on main branch commits: thus rebuild documentation of version that has 'latest' alias.
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
needs:
|
||||||
|
- docker-main-branch
|
||||||
|
- typedocs
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
- run: pip install mkdocs-material
|
||||||
|
- run: pip install mike
|
||||||
|
- run: apt-get update && apt-get install -y jq
|
||||||
|
- run: git config user.name ci-bot
|
||||||
|
- run: git config user.email ci-bot@example.com
|
||||||
|
- name: Extract major version from package.json
|
||||||
|
run: VERSION=$(git show origin/main:package.json | jq -r .version | grep -Po '^(\d+)').x
|
||||||
|
- run: git fetch origin gh-pages --depth=1
|
||||||
|
- run: cd documentation && mike deploy --push --update-aliases ${VERSION} latest
|
||||||
|
|
||||||
publish-docs:
|
publish-docs:
|
||||||
|
# When a new version is tagged, upload the generated typedocs to the appropriate mkdocs <major.x> folder.
|
||||||
needs:
|
needs:
|
||||||
- mkdocs
|
- mkdocs-tag
|
||||||
- lint
|
- lint
|
||||||
- test-unit
|
- test-unit
|
||||||
- test-integration
|
- test-integration
|
||||||
@ -332,4 +368,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./docs
|
publish_dir: ./docs
|
||||||
destination_dir: ${{steps.get_version.outputs.major}}.${{steps.get_version.outputs.minor}}/docs
|
destination_dir: ${{steps.get_version.outputs.major}}.x/docs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user