ci: build docs in source directory for consistency All the other workflows jobs check out into the `source` directory; do this in the documentation build job as well, for consistency across jobs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index fabc58c..d4a74d6 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -268,19 +268,13 @@ jobs:
needs: [build_containers]
runs-on: ubuntu-latest
steps:
- - name: Setup defaults
- run: |
- if [ "${{ matrix.container.dockerfile }}" = "" ]; then
- echo "dockerfile=${{ matrix.container.dockerfile }}" >> $GITHUB_ENV
- else
- echo "dockerfile=${{ matrix.container.dockerfile }}" >> $GITHUB_ENV
- fi
- name: Check out repository
uses: actions/checkout@v2
with:
path: source
fetch-depth: 0
- name: Generate documentation
+ working-directory: source
run: |
git config user.name 'Documentation Generation'
git config user.email 'libgit2@users.noreply.github.com'
@@ -288,7 +282,7 @@ jobs:
docker login https://${{ env.docker-registry }} -u ${{ github.actor }} -p ${{ github.token }}
docker run \
--rm \
- -v "$(pwd)/source:/home/libgit2/source" \
+ -v "$(pwd):/home/libgit2" \
-w /home/libgit2/source \
${{ env.docker-registry }}/${{ github.repository }}/docurium:latest \
cm doc api.docurium
@@ -298,7 +292,8 @@ jobs:
name: Upload artifact
with:
name: api-documentation
- path: api-documentation.zip
+ path: source/api-documentation.zip
- name: Push documentation branch
+ working-directory: source
run: git push origin gh-pages
if: github.event_name != 'pull_request' && github.repository == 'libgit2/libgit2'