Skip to content

Commit 60bdce8

Browse files
authored
💚 api_docs creates branch if needed (#62)
1 parent b288f91 commit 60bdce8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/api_docs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ jobs:
3939
runs-on: ubuntu-latest
4040
steps:
4141
- uses: actions/checkout@v3
42-
with:
43-
ref: api-doc
42+
- run: git checkout api-doc 2>/dev/null || git checkout -b api-doc
4443
- uses: actions/setup-python@v4
4544
with:
4645
python-version: 3.x
@@ -50,7 +49,9 @@ jobs:
5049
path: "docs/api/"
5150

5251
# Enter `docs/`
52+
- run: mkdir -p docs/
5353
- run: cd docs/
54+
# TODO(#61): This should use the version's script
5455
- run: wget https://raw.githubusercontent.com/libhal/ci/refs/heads/main/scripts/add_version_to_switcher.py
5556
- run: python3 add_version_to_switcher.py ${{ github.ref_name }} "https://libhal.github.io/${{ github.event.repository.name }}/api"
5657
- run: rm add_version_to_switcher.py
@@ -61,7 +62,7 @@ jobs:
6162
- run: git config user.email ci-bot@example.com
6263
- run: git add docs
6364
- run: git commit -m "API Docs for version ${{ github.ref_name }}"
64-
- run: git push origin gh-pages
65+
- run: git push origin api-docs
6566
- name: Upload static files as artifact
6667
id: deployment
6768
uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)