From 430d1d0ad94b430772d46f84de89d3956c42c132 Mon Sep 17 00:00:00 2001 From: theguy951357 Date: Tue, 2 Jan 2024 15:53:12 -0500 Subject: [PATCH 01/10] initial workflows. --- .github/workflows/deploysphinx.yml | 8 ++++++++ .github/workflows/prcheck.yml | 12 ++++++++++++ .github/workflows/readthedocsdeploy.yml | 16 ++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 .github/workflows/deploysphinx.yml create mode 100644 .github/workflows/prcheck.yml create mode 100644 .github/workflows/readthedocsdeploy.yml diff --git a/.github/workflows/deploysphinx.yml b/.github/workflows/deploysphinx.yml new file mode 100644 index 00000000..f115f0a2 --- /dev/null +++ b/.github/workflows/deploysphinx.yml @@ -0,0 +1,8 @@ +name: create docker image + +on: + workflow_dispatch: + inputs: + version: + description: "new version number" + required: true \ No newline at end of file diff --git a/.github/workflows/prcheck.yml b/.github/workflows/prcheck.yml new file mode 100644 index 00000000..e6784be7 --- /dev/null +++ b/.github/workflows/prcheck.yml @@ -0,0 +1,12 @@ +name: "Pull Request Docs Check" +on: +- pull_request + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: ammaraskar/sphinx-action@master + with: + docs-folder: "docs/" \ No newline at end of file diff --git a/.github/workflows/readthedocsdeploy.yml b/.github/workflows/readthedocsdeploy.yml new file mode 100644 index 00000000..d09b89e2 --- /dev/null +++ b/.github/workflows/readthedocsdeploy.yml @@ -0,0 +1,16 @@ +# copied from https://rtds-action.readthedocs.io/en/latest/ +# need to get webhook token from readthedocs. +name: Docs +on: workflow_dispatch + +jobs: + notebooks: + name: "Build the docs for readthedocs.org" + runs-on: ubuntu-latest + steps: + - name: Trigger RTDs build + uses: dfm/rtds-action@v1 + with: + webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }} + webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }} + commit_ref: ${{ github.ref }} \ No newline at end of file From e806821dc0cb875643eeebf143f03520ffdb6d78 Mon Sep 17 00:00:00 2001 From: theguy951357 Date: Tue, 2 Jan 2024 15:54:45 -0500 Subject: [PATCH 02/10] stuff --- .github/workflows/deploysphinx.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploysphinx.yml b/.github/workflows/deploysphinx.yml index f115f0a2..57dc4a50 100644 --- a/.github/workflows/deploysphinx.yml +++ b/.github/workflows/deploysphinx.yml @@ -1,3 +1,4 @@ +# need to figure out how to get from netmaker-devops repo to get the dockerfile and modhtml.sh script to build it. name: create docker image on: From 54005d4d634ee51e0069f6c0b98813cb5f6a1d4a Mon Sep 17 00:00:00 2001 From: theguy951357 Date: Wed, 3 Jan 2024 08:12:35 -0500 Subject: [PATCH 03/10] notes --- .github/workflows/readthedocsdeploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/readthedocsdeploy.yml b/.github/workflows/readthedocsdeploy.yml index d09b89e2..677a46f0 100644 --- a/.github/workflows/readthedocsdeploy.yml +++ b/.github/workflows/readthedocsdeploy.yml @@ -1,5 +1,6 @@ # copied from https://rtds-action.readthedocs.io/en/latest/ # need to get webhook token from readthedocs. +# You should also edit your webhook settings on GitHub by going to https://github.com/USERNAME/REPONAME/settings/hooks and clicking “Edit” next to the ReadTheDocs hook. On that page, you should un-check the Pushes option. name: Docs on: workflow_dispatch From 721d4e588723f4e53a46effe71d814036eaa21bd Mon Sep 17 00:00:00 2001 From: theguy951357 Date: Wed, 3 Jan 2024 14:05:18 -0500 Subject: [PATCH 04/10] docker build --- .github/workflows/deploysphinx.yml | 36 ++++++++++++++++++++++++- .github/workflows/readthedocsdeploy.yml | 2 +- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploysphinx.yml b/.github/workflows/deploysphinx.yml index 57dc4a50..bbae4aa4 100644 --- a/.github/workflows/deploysphinx.yml +++ b/.github/workflows/deploysphinx.yml @@ -6,4 +6,38 @@ on: inputs: version: description: "new version number" - required: true \ No newline at end of file + required: true + +jobs: + + build-docs: + runs-on: ubuntu-latest + + + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + repository: gravitl/netmaker-docs + ref: master + - name: Setup QEMU + uses: docker/setup-qemu-action@v2 + - name: Setup Docker Buildx + uses: docker/setup=buildx-action@v2 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and Push + uses: docker/build-push-action@v3 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64 + push: true + tags: | + gravitl/netmaker-docs:${{ inputs.version }} + gravitl/netmaker-docs:latest diff --git a/.github/workflows/readthedocsdeploy.yml b/.github/workflows/readthedocsdeploy.yml index 677a46f0..9e462e27 100644 --- a/.github/workflows/readthedocsdeploy.yml +++ b/.github/workflows/readthedocsdeploy.yml @@ -5,7 +5,7 @@ name: Docs on: workflow_dispatch jobs: - notebooks: + deploy_readthedocs: name: "Build the docs for readthedocs.org" runs-on: ubuntu-latest steps: From e6c8dfd010e4687d1a4a6eaad8f3faca1752c00d Mon Sep 17 00:00:00 2001 From: theguy951357 Date: Thu, 4 Jan 2024 15:44:48 -0500 Subject: [PATCH 05/10] finish up deploy. --- .github/workflows/deploysphinx.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploysphinx.yml b/.github/workflows/deploysphinx.yml index bbae4aa4..7cb8f555 100644 --- a/.github/workflows/deploysphinx.yml +++ b/.github/workflows/deploysphinx.yml @@ -9,19 +9,28 @@ on: required: true jobs: - - build-docs: - runs-on: ubuntu-latest - - docker: runs-on: ubuntu-latest steps: + - name: Setup git + run: | + git config --global user.name "Gravitl" + git config --global user.email "info@netmaker.io" - name: Checkout uses: actions/checkout@v3 with: repository: gravitl/netmaker-docs ref: master + - name: Build Docs + env: + TOKEN: ${{ secrets.repo_token }} + run: | + curl -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/gravitl/netmaker-devops/master/netmaker-docs/Dockerfile + curl -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/gravitl/netmaker-devops/master/netmaker-docs/mod-html.sh + mv Dockerfile netmaker-docs + mv mod-html.sh netmaker-docs + cd netmaker-docs + make html - name: Setup QEMU uses: docker/setup-qemu-action@v2 - name: Setup Docker Buildx @@ -41,3 +50,6 @@ jobs: tags: | gravitl/netmaker-docs:${{ inputs.version }} gravitl/netmaker-docs:latest + - name: Update Server + run: | + ssh root@143.198.165.134 "bash updateimage.sh ${{ inputs.version }}" From a43d66e4eb13b9e4ebf9d57603a262e435ac86da Mon Sep 17 00:00:00 2001 From: theguy951357 Date: Thu, 4 Jan 2024 15:55:08 -0500 Subject: [PATCH 06/10] folder fix --- .github/workflows/prcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prcheck.yml b/.github/workflows/prcheck.yml index e6784be7..2befd8d9 100644 --- a/.github/workflows/prcheck.yml +++ b/.github/workflows/prcheck.yml @@ -9,4 +9,4 @@ jobs: - uses: actions/checkout@v1 - uses: ammaraskar/sphinx-action@master with: - docs-folder: "docs/" \ No newline at end of file + docs-folder: "netmaker-docs/" \ No newline at end of file From 6cff1858f61ac50904c9b1c27ea6f02a6f1616ac Mon Sep 17 00:00:00 2001 From: theguy951357 Date: Thu, 4 Jan 2024 15:58:08 -0500 Subject: [PATCH 07/10] testing something --- .github/workflows/prcheck.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prcheck.yml b/.github/workflows/prcheck.yml index 2befd8d9..1c9a0111 100644 --- a/.github/workflows/prcheck.yml +++ b/.github/workflows/prcheck.yml @@ -8,5 +8,5 @@ jobs: steps: - uses: actions/checkout@v1 - uses: ammaraskar/sphinx-action@master - with: - docs-folder: "netmaker-docs/" \ No newline at end of file + # with: + # docs-folder: "netmaker-docs/" \ No newline at end of file From 09d8ca7523d18e96b32e862cdd36dc5bcf09adc8 Mon Sep 17 00:00:00 2001 From: theguy951357 Date: Thu, 4 Jan 2024 16:08:22 -0500 Subject: [PATCH 08/10] thing --- .github/workflows/prcheck.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prcheck.yml b/.github/workflows/prcheck.yml index 1c9a0111..34c1867c 100644 --- a/.github/workflows/prcheck.yml +++ b/.github/workflows/prcheck.yml @@ -8,5 +8,5 @@ jobs: steps: - uses: actions/checkout@v1 - uses: ammaraskar/sphinx-action@master - # with: - # docs-folder: "netmaker-docs/" \ No newline at end of file + with: + docs-folder: "index.rst" \ No newline at end of file From f138dc2a13e8a634a7a73f3a614c52c219ecb6a8 Mon Sep 17 00:00:00 2001 From: theguy951357 Date: Thu, 4 Jan 2024 16:09:32 -0500 Subject: [PATCH 09/10] trying current directory --- .github/workflows/prcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prcheck.yml b/.github/workflows/prcheck.yml index 34c1867c..646be8d8 100644 --- a/.github/workflows/prcheck.yml +++ b/.github/workflows/prcheck.yml @@ -9,4 +9,4 @@ jobs: - uses: actions/checkout@v1 - uses: ammaraskar/sphinx-action@master with: - docs-folder: "index.rst" \ No newline at end of file + docs-folder: "." \ No newline at end of file From 2eb94a0b263c10e1e4668a08b3e93ec8e0df711d Mon Sep 17 00:00:00 2001 From: theguy951357 Date: Wed, 10 Jan 2024 14:42:51 -0500 Subject: [PATCH 10/10] change docsdeploy run workflow on netmaker-devops --- .github/workflows/deploysphinx.yml | 55 ------------------------- .github/workflows/docsdeploy.yml | 19 +++++++++ .github/workflows/readthedocsdeploy.yml | 2 +- 3 files changed, 20 insertions(+), 56 deletions(-) delete mode 100644 .github/workflows/deploysphinx.yml create mode 100644 .github/workflows/docsdeploy.yml diff --git a/.github/workflows/deploysphinx.yml b/.github/workflows/deploysphinx.yml deleted file mode 100644 index 7cb8f555..00000000 --- a/.github/workflows/deploysphinx.yml +++ /dev/null @@ -1,55 +0,0 @@ -# need to figure out how to get from netmaker-devops repo to get the dockerfile and modhtml.sh script to build it. -name: create docker image - -on: - workflow_dispatch: - inputs: - version: - description: "new version number" - required: true - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Setup git - run: | - git config --global user.name "Gravitl" - git config --global user.email "info@netmaker.io" - - name: Checkout - uses: actions/checkout@v3 - with: - repository: gravitl/netmaker-docs - ref: master - - name: Build Docs - env: - TOKEN: ${{ secrets.repo_token }} - run: | - curl -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/gravitl/netmaker-devops/master/netmaker-docs/Dockerfile - curl -H "Authorization: token ${TOKEN}" https://raw.githubusercontent.com/gravitl/netmaker-devops/master/netmaker-docs/mod-html.sh - mv Dockerfile netmaker-docs - mv mod-html.sh netmaker-docs - cd netmaker-docs - make html - - name: Setup QEMU - uses: docker/setup-qemu-action@v2 - - name: Setup Docker Buildx - uses: docker/setup=buildx-action@v2 - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and Push - uses: docker/build-push-action@v3 - with: - context: . - file: ./Dockerfile - platforms: linux/amd64 - push: true - tags: | - gravitl/netmaker-docs:${{ inputs.version }} - gravitl/netmaker-docs:latest - - name: Update Server - run: | - ssh root@143.198.165.134 "bash updateimage.sh ${{ inputs.version }}" diff --git a/.github/workflows/docsdeploy.yml b/.github/workflows/docsdeploy.yml new file mode 100644 index 00000000..cf545a4e --- /dev/null +++ b/.github/workflows/docsdeploy.yml @@ -0,0 +1,19 @@ +# creates a release from master +# builds docs, pushes to docker hub and updates docs server + +name: Docs_deploy + +on: + workflow_dispatch: + inputs: + version: + description: "new version number" + required: true + +jobs: + + release: + uses: gravitl/netmaker-devops/.github/workflows/deploydocs.yml@master + with: + version: ${{ inputs.version }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/readthedocsdeploy.yml b/.github/workflows/readthedocsdeploy.yml index 9e462e27..7f0cf84e 100644 --- a/.github/workflows/readthedocsdeploy.yml +++ b/.github/workflows/readthedocsdeploy.yml @@ -6,7 +6,7 @@ on: workflow_dispatch jobs: deploy_readthedocs: - name: "Build the docs for readthedocs.org" + name: "Deploy Readthedocs" runs-on: ubuntu-latest steps: - name: Trigger RTDs build