From 1b7749951c8a339746b83dc7d0a72276fcffe164 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Mon, 18 Jul 2022 15:04:34 -0400 Subject: [PATCH 01/10] publish yardoc pages to gh-pages --- .github/workflows/publish_yarndoc.yml | 36 +++++++++++++++++++++++++++ .gitignore | 6 ++++- docs/.keep | 0 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish_yarndoc.yml create mode 100644 docs/.keep diff --git a/.github/workflows/publish_yarndoc.yml b/.github/workflows/publish_yarndoc.yml new file mode 100644 index 000000000..aac7653cf --- /dev/null +++ b/.github/workflows/publish_yarndoc.yml @@ -0,0 +1,36 @@ +name: Publish yarndoc + +on: + workflow_dispatch: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: Setup Ruby using Bundler + uses: ruby/setup-ruby@v1 + + - name: install gems + run: bundle install && gem install yardoc + + - name: generate documentation + run: yardoc --output-dir docs/ + + - name: save docs and publish + env: + GIT_AUTHOR_NAME: "oscwiag" + GIT_AUTHOR_EMAIL: "oscwiag@gmail.com" + run: | + git checkout gh-pages + git add docs/ + git commit -m 'new docs' + git push https://{{ secrets.OSC_WIAG_PUB_REPO_TOKEN }}@github.com/osc/ood_core.git diff --git a/.gitignore b/.gitignore index 90f57ac93..bcbe123c9 100644 --- a/.gitignore +++ b/.gitignore @@ -50,4 +50,8 @@ Gemfile.lock .rvmrc # SSHFS temp files -._* \ No newline at end of file +._* + +# docs are only held in the gh-pages branch +/docs/* +!/docs/.keep diff --git a/docs/.keep b/docs/.keep new file mode 100644 index 000000000..e69de29bb From baea62a08e184052c325276cae50f15d48973dbf Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Mon, 18 Jul 2022 15:13:13 -0400 Subject: [PATCH 02/10] specify ruby version --- .github/workflows/publish_yarndoc.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish_yarndoc.yml b/.github/workflows/publish_yarndoc.yml index aac7653cf..a5ac301b1 100644 --- a/.github/workflows/publish_yarndoc.yml +++ b/.github/workflows/publish_yarndoc.yml @@ -18,6 +18,8 @@ jobs: - name: Setup Ruby using Bundler uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' - name: install gems run: bundle install && gem install yardoc From edddc78e41b6c6d1380378900f9eab0fb68440c0 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Mon, 18 Jul 2022 15:15:08 -0400 Subject: [PATCH 03/10] use the right gem --- .github/workflows/publish_yarndoc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_yarndoc.yml b/.github/workflows/publish_yarndoc.yml index a5ac301b1..35f64619e 100644 --- a/.github/workflows/publish_yarndoc.yml +++ b/.github/workflows/publish_yarndoc.yml @@ -22,7 +22,7 @@ jobs: ruby-version: '3.0' - name: install gems - run: bundle install && gem install yardoc + run: bundle install && gem install yard - name: generate documentation run: yardoc --output-dir docs/ From c9e24c72186c84aeddf70440163f0af64cc68450 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Mon, 18 Jul 2022 15:17:55 -0400 Subject: [PATCH 04/10] rework publish a little --- .github/workflows/publish_yarndoc.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_yarndoc.yml b/.github/workflows/publish_yarndoc.yml index 35f64619e..82dcb0b9c 100644 --- a/.github/workflows/publish_yarndoc.yml +++ b/.github/workflows/publish_yarndoc.yml @@ -25,14 +25,17 @@ jobs: run: bundle install && gem install yard - name: generate documentation - run: yardoc --output-dir docs/ + run: yardoc --output-dir /tmp/docs/ - name: save docs and publish env: GIT_AUTHOR_NAME: "oscwiag" GIT_AUTHOR_EMAIL: "oscwiag@gmail.com" run: | + git clone https://{{ secrets.OSC_WIAG_PUB_REPO_TOKEN }}@github.com/osc/ood_core.git /tmp/core + cd /tmp/core git checkout gh-pages - git add docs/ + mv /tmp/docs . git commit -m 'new docs' - git push https://{{ secrets.OSC_WIAG_PUB_REPO_TOKEN }}@github.com/osc/ood_core.git + git push + From 049ee32707319d481023c403111166a94d5273d2 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Mon, 18 Jul 2022 15:20:00 -0400 Subject: [PATCH 05/10] needs a $ --- .github/workflows/publish_yarndoc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_yarndoc.yml b/.github/workflows/publish_yarndoc.yml index 82dcb0b9c..8831df5df 100644 --- a/.github/workflows/publish_yarndoc.yml +++ b/.github/workflows/publish_yarndoc.yml @@ -32,7 +32,7 @@ jobs: GIT_AUTHOR_NAME: "oscwiag" GIT_AUTHOR_EMAIL: "oscwiag@gmail.com" run: | - git clone https://{{ secrets.OSC_WIAG_PUB_REPO_TOKEN }}@github.com/osc/ood_core.git /tmp/core + git clone https://${{ secrets.OSC_WIAG_PUB_REPO_TOKEN }}@github.com/osc/ood_core.git /tmp/core cd /tmp/core git checkout gh-pages mv /tmp/docs . From a4e99c3a49b0333b8f2b466d2cb0b422f8362e43 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Mon, 18 Jul 2022 15:22:20 -0400 Subject: [PATCH 06/10] add a --force --- .github/workflows/publish_yarndoc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_yarndoc.yml b/.github/workflows/publish_yarndoc.yml index 8831df5df..c4b726629 100644 --- a/.github/workflows/publish_yarndoc.yml +++ b/.github/workflows/publish_yarndoc.yml @@ -35,7 +35,7 @@ jobs: git clone https://${{ secrets.OSC_WIAG_PUB_REPO_TOKEN }}@github.com/osc/ood_core.git /tmp/core cd /tmp/core git checkout gh-pages - mv /tmp/docs . + mv --force /tmp/docs . git commit -m 'new docs' git push From e836133ce002b35a9460438d0500449b8caa8ba2 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Mon, 18 Jul 2022 15:30:30 -0400 Subject: [PATCH 07/10] ok wipe doc directory --- .github/workflows/publish_yarndoc.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_yarndoc.yml b/.github/workflows/publish_yarndoc.yml index c4b726629..0022867b9 100644 --- a/.github/workflows/publish_yarndoc.yml +++ b/.github/workflows/publish_yarndoc.yml @@ -35,7 +35,8 @@ jobs: git clone https://${{ secrets.OSC_WIAG_PUB_REPO_TOKEN }}@github.com/osc/ood_core.git /tmp/core cd /tmp/core git checkout gh-pages - mv --force /tmp/docs . + rm -rf docs/ + mv /tmp/docs . git commit -m 'new docs' git push From ad306da3a803c5546844e99d6f587dd41afba0f0 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Mon, 18 Jul 2022 15:33:17 -0400 Subject: [PATCH 08/10] need to add and config --- .github/workflows/publish_yarndoc.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_yarndoc.yml b/.github/workflows/publish_yarndoc.yml index 0022867b9..e93fd40c8 100644 --- a/.github/workflows/publish_yarndoc.yml +++ b/.github/workflows/publish_yarndoc.yml @@ -28,15 +28,15 @@ jobs: run: yardoc --output-dir /tmp/docs/ - name: save docs and publish - env: - GIT_AUTHOR_NAME: "oscwiag" - GIT_AUTHOR_EMAIL: "oscwiag@gmail.com" run: | git clone https://${{ secrets.OSC_WIAG_PUB_REPO_TOKEN }}@github.com/osc/ood_core.git /tmp/core + git config --global user.name "oscwiag" + git config --global user.email "oscwiag@gmail.com" cd /tmp/core git checkout gh-pages rm -rf docs/ mv /tmp/docs . + git add docs/ git commit -m 'new docs' git push From 0d733d3e67ac96e65c880f37742e1ba613998576 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Mon, 18 Jul 2022 15:41:23 -0400 Subject: [PATCH 09/10] use osc-robot instead of oscwiag --- .github/workflows/publish_yarndoc.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_yarndoc.yml b/.github/workflows/publish_yarndoc.yml index e93fd40c8..831e81e53 100644 --- a/.github/workflows/publish_yarndoc.yml +++ b/.github/workflows/publish_yarndoc.yml @@ -29,9 +29,9 @@ jobs: - name: save docs and publish run: | - git clone https://${{ secrets.OSC_WIAG_PUB_REPO_TOKEN }}@github.com/osc/ood_core.git /tmp/core - git config --global user.name "oscwiag" - git config --global user.email "oscwiag@gmail.com" + git clone https://${{ secrets.OSC_ROBOT_GH_PUB_REPO_TOKEN }}@github.com/osc/ood_core.git /tmp/core + git config --global user.name "${{ secrets.OSC_ROBOT_GH_USER }}" + git config --global user.email "${{ secrets.OSC_ROBOT_GH_USER_EMAIL }}" cd /tmp/core git checkout gh-pages rm -rf docs/ From d9cc3c8ea2820c105ef6647ee461c8bf07176667 Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Mon, 18 Jul 2022 15:44:35 -0400 Subject: [PATCH 10/10] this works, so rm these on rules for testing --- .github/workflows/publish_yarndoc.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/publish_yarndoc.yml b/.github/workflows/publish_yarndoc.yml index 831e81e53..121939d10 100644 --- a/.github/workflows/publish_yarndoc.yml +++ b/.github/workflows/publish_yarndoc.yml @@ -1,13 +1,9 @@ name: Publish yarndoc on: - workflow_dispatch: push: branches: - master - pull_request: - branches: - - master jobs: publish: