From 1aa6fe8535185261d7786283c04560be7f6d8f0a Mon Sep 17 00:00:00 2001 From: grossmj Date: Fri, 23 Oct 2020 23:03:50 +1030 Subject: [PATCH 1/6] Add publish_api_documentation.yml to master branch for scheduled event to work. --- .../workflows/publish_api_documentation.yml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/publish_api_documentation.yml diff --git a/.github/workflows/publish_api_documentation.yml b/.github/workflows/publish_api_documentation.yml new file mode 100644 index 00000000..199ea349 --- /dev/null +++ b/.github/workflows/publish_api_documentation.yml @@ -0,0 +1,41 @@ +name: publish-api-documentation + +on: + schedule: + - cron: "0 0 * * *" + push: + tags: + - v3.* + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0 + - uses: actions/setup-python@v2 + with: + python-version: 3.6 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install GNS3 server + run: | + python setup.py install + - name: Generate the API documentation + run: | + cd scripts + python3 publish_api_documentation.py + - name: Publish the API documentation + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git checkout gh-pages + git add docs + git status + git commit -m "Publish API documentation" + git push From 83fbd1f62705baa934cfd03964fde0d747ce6c32 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 24 Oct 2020 12:16:05 +1030 Subject: [PATCH 2/6] Fix GitHub Actions error: A branch or tag with the name '3' could not be found. --- .github/workflows/publish_api_documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_api_documentation.yml b/.github/workflows/publish_api_documentation.yml index 199ea349..32663ec4 100644 --- a/.github/workflows/publish_api_documentation.yml +++ b/.github/workflows/publish_api_documentation.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: 3.0 + ref: "3.0" - uses: actions/setup-python@v2 with: python-version: 3.6 From d063b3e39d23268b4dc0c57990c571fe95ea7a15 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 24 Oct 2020 13:08:10 +1030 Subject: [PATCH 3/6] Manual trigger API documentation publishing using workflow_dispatch --- .github/workflows/publish_api_documentation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish_api_documentation.yml b/.github/workflows/publish_api_documentation.yml index 32663ec4..8867170f 100644 --- a/.github/workflows/publish_api_documentation.yml +++ b/.github/workflows/publish_api_documentation.yml @@ -1,6 +1,7 @@ name: publish-api-documentation on: + workflow_dispatch: schedule: - cron: "0 0 * * *" push: From fb8df1cc6beb0ae017007896b9822c1108d72c37 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 24 Oct 2020 13:13:19 +1030 Subject: [PATCH 4/6] Fetch all history for all tags and branches in publish_api_documentation.yml --- .github/workflows/publish_api_documentation.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish_api_documentation.yml b/.github/workflows/publish_api_documentation.yml index 8867170f..46c09875 100644 --- a/.github/workflows/publish_api_documentation.yml +++ b/.github/workflows/publish_api_documentation.yml @@ -16,6 +16,7 @@ jobs: steps: - uses: actions/checkout@v2 with: + fetch-depth: 0 ref: "3.0" - uses: actions/setup-python@v2 with: From d2b7c9bcbf4f1484248cc672036811845eeef63b Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 24 Oct 2020 13:38:32 +1030 Subject: [PATCH 5/6] Do not build API documentation on schedule. --- .github/workflows/publish_api_documentation.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/publish_api_documentation.yml b/.github/workflows/publish_api_documentation.yml index 46c09875..59289038 100644 --- a/.github/workflows/publish_api_documentation.yml +++ b/.github/workflows/publish_api_documentation.yml @@ -2,8 +2,6 @@ name: publish-api-documentation on: workflow_dispatch: - schedule: - - cron: "0 0 * * *" push: tags: - v3.* From 163a867f00a51691db62df34e80753a11d52e389 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 24 Oct 2020 15:24:32 +1030 Subject: [PATCH 6/6] Only automatically build API documentation for 3.0 branch and v3.* tags --- .github/workflows/publish_api_documentation.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish_api_documentation.yml b/.github/workflows/publish_api_documentation.yml index 59289038..d20e5f49 100644 --- a/.github/workflows/publish_api_documentation.yml +++ b/.github/workflows/publish_api_documentation.yml @@ -3,6 +3,8 @@ name: publish-api-documentation on: workflow_dispatch: push: + branches: + - 3.0 tags: - v3.*