From 27d900190c48078239ebb6cf80beac1e303b87c5 Mon Sep 17 00:00:00 2001 From: kss2k Date: Tue, 15 Oct 2024 17:34:59 +0200 Subject: [PATCH 01/12] inital attempt --- .github/workflows/pkgdown.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/pkgdown.yml diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml new file mode 100644 index 0000000..9f99b45 --- /dev/null +++ b/.github/workflows/pkgdown.yml @@ -0,0 +1,41 @@ +name: pkgdown + +on: + push: + branches: + - main + - push-to-gh-pages + +jobs: + test: + runs-on: ubuntu-latest + + container: + image: ghcr.io/kss2k/container-modsem:latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GHCR_PAT }} + + steps: + - name: Check out the repository + uses: actions/checkout@v4 + + - name: build pkgdown site + run: | + git clone https://github.com/kss2k/modsem + cd modsem/vignettes + # make vignettes print their ouptut on the pkgdown site + ls -A *.Rmd | xargs sed -i "s/EVAL_DEFAULT <- FALSE/EVAL_DEFAULT <- TRUE/" + cd .. + git clone https://github.com/kss2k/modsem --branch pkgdown + mv pkgdown docs + Rscript -e 'pkgdown::build_site(preview = FALSE)' + - name: Commit and push changes to pkgdown branch + run: | + echo "https://x-access-token:${GITHUB_TOKEN}@github.com" > ~/.git-credentials + cd docs + git add --all + git commit -m "Update pkgdown site [skip ci]" || echo "No changes to commit" + git push origin pkgdown + env: + GITHUB_TOKEN: ${{ secrets.PKGDOWN_TOKEN }} From 2e1ca0eb9970517623cde1c770b320130731b6b2 Mon Sep 17 00:00:00 2001 From: kss2k Date: Tue, 15 Oct 2024 17:40:41 +0200 Subject: [PATCH 02/12] clone directly into docs/ --- .github/workflows/pkgdown.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index 9f99b45..e0c5f19 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -26,9 +26,7 @@ jobs: cd modsem/vignettes # make vignettes print their ouptut on the pkgdown site ls -A *.Rmd | xargs sed -i "s/EVAL_DEFAULT <- FALSE/EVAL_DEFAULT <- TRUE/" - cd .. - git clone https://github.com/kss2k/modsem --branch pkgdown - mv pkgdown docs + git clone https://github.com/kss2k/modsem --branch pkgdown docs Rscript -e 'pkgdown::build_site(preview = FALSE)' - name: Commit and push changes to pkgdown branch run: | From 171c83813b12cfe30ff08392846f646437a46442 Mon Sep 17 00:00:00 2001 From: kss2k Date: Tue, 15 Oct 2024 17:42:35 +0200 Subject: [PATCH 03/12] cd out of vignettes/ --- .github/workflows/pkgdown.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index e0c5f19..2d0d84c 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -24,6 +24,7 @@ jobs: run: | git clone https://github.com/kss2k/modsem cd modsem/vignettes + cd .. # make vignettes print their ouptut on the pkgdown site ls -A *.Rmd | xargs sed -i "s/EVAL_DEFAULT <- FALSE/EVAL_DEFAULT <- TRUE/" git clone https://github.com/kss2k/modsem --branch pkgdown docs From 5f68e6a1057d8206fb34c6378287c25ab2eb1fa1 Mon Sep 17 00:00:00 2001 From: kss2k Date: Tue, 15 Oct 2024 17:43:17 +0200 Subject: [PATCH 04/12] rename job --- .github/workflows/pkgdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index 2d0d84c..77f78db 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -7,7 +7,7 @@ on: - push-to-gh-pages jobs: - test: + push-to-gh-pages: runs-on: ubuntu-latest container: From 896baf2bf9ac7553446bcaff62b59e6f991f5173 Mon Sep 17 00:00:00 2001 From: kss2k Date: Tue, 15 Oct 2024 17:44:06 +0200 Subject: [PATCH 05/12] dont cd out of vignettes/ to early --- .github/workflows/pkgdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index 77f78db..d19055e 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -24,9 +24,9 @@ jobs: run: | git clone https://github.com/kss2k/modsem cd modsem/vignettes - cd .. # make vignettes print their ouptut on the pkgdown site ls -A *.Rmd | xargs sed -i "s/EVAL_DEFAULT <- FALSE/EVAL_DEFAULT <- TRUE/" + cd .. git clone https://github.com/kss2k/modsem --branch pkgdown docs Rscript -e 'pkgdown::build_site(preview = FALSE)' - name: Commit and push changes to pkgdown branch From 48d017be695a2c3cf63c138b2560ce2344116b39 Mon Sep 17 00:00:00 2001 From: Kjell S Slupphaug Date: Tue, 15 Oct 2024 18:01:47 +0200 Subject: [PATCH 06/12] cd into modsem/docs not docs/ --- .github/workflows/pkgdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index d19055e..40dccc4 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -32,7 +32,7 @@ jobs: - name: Commit and push changes to pkgdown branch run: | echo "https://x-access-token:${GITHUB_TOKEN}@github.com" > ~/.git-credentials - cd docs + cd modsem/docs git add --all git commit -m "Update pkgdown site [skip ci]" || echo "No changes to commit" git push origin pkgdown From 44251a0fba6f733ac490c975455e7c8087369574 Mon Sep 17 00:00:00 2001 From: Kjell S Slupphaug Date: Tue, 15 Oct 2024 18:23:46 +0200 Subject: [PATCH 07/12] config git --- .github/workflows/pkgdown.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index 40dccc4..fd960c5 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -32,6 +32,8 @@ jobs: - name: Commit and push changes to pkgdown branch run: | echo "https://x-access-token:${GITHUB_TOKEN}@github.com" > ~/.git-credentials + git config --global user.name "${{ github.actor }}" + git config --global user.email "${{ github.actor }}@users.noreply.github.com" cd modsem/docs git add --all git commit -m "Update pkgdown site [skip ci]" || echo "No changes to commit" From f8343a1a61fd986992fdb155dd06578968a25ecd Mon Sep 17 00:00:00 2001 From: kss2k Date: Tue, 15 Oct 2024 18:49:57 +0200 Subject: [PATCH 08/12] use token in url --- .github/workflows/pkgdown.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index fd960c5..8fc39b4 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -25,18 +25,19 @@ jobs: git clone https://github.com/kss2k/modsem cd modsem/vignettes # make vignettes print their ouptut on the pkgdown site - ls -A *.Rmd | xargs sed -i "s/EVAL_DEFAULT <- FALSE/EVAL_DEFAULT <- TRUE/" + # ls -A *.Rmd | xargs sed -i "s/EVAL_DEFAULT <- FALSE/EVAL_DEFAULT <- TRUE/" cd .. git clone https://github.com/kss2k/modsem --branch pkgdown docs Rscript -e 'pkgdown::build_site(preview = FALSE)' + - name: Commit and push changes to pkgdown branch - name: Commit and push changes to pkgdown branch run: | - echo "https://x-access-token:${GITHUB_TOKEN}@github.com" > ~/.git-credentials git config --global user.name "${{ github.actor }}" git config --global user.email "${{ github.actor }}@users.noreply.github.com" cd modsem/docs git add --all git commit -m "Update pkgdown site [skip ci]" || echo "No changes to commit" + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git git push origin pkgdown env: - GITHUB_TOKEN: ${{ secrets.PKGDOWN_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2ab9a0ad604aecfce82fee3071908b59ef9bd1ca Mon Sep 17 00:00:00 2001 From: kss2k Date: Tue, 15 Oct 2024 18:50:59 +0200 Subject: [PATCH 09/12] use token in url v2 --- .github/workflows/pkgdown.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index 8fc39b4..408a38d 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -29,7 +29,6 @@ jobs: cd .. git clone https://github.com/kss2k/modsem --branch pkgdown docs Rscript -e 'pkgdown::build_site(preview = FALSE)' - - name: Commit and push changes to pkgdown branch - name: Commit and push changes to pkgdown branch run: | git config --global user.name "${{ github.actor }}" From d8db9c5de1513fdb62c7a4ce3cb6d70b7748ba1b Mon Sep 17 00:00:00 2001 From: kss2k Date: Tue, 15 Oct 2024 19:17:22 +0200 Subject: [PATCH 10/12] permissions: write --- .github/workflows/pkgdown.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index 408a38d..d8a0494 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -16,6 +16,10 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GHCR_PAT }} + permissions: + contents: write + packages: write + steps: - name: Check out the repository uses: actions/checkout@v4 From 98fca118beac814a879f55fd2c38dd72387fe547 Mon Sep 17 00:00:00 2001 From: kss2k Date: Tue, 15 Oct 2024 19:25:59 +0200 Subject: [PATCH 11/12] print full output for examples --- .github/workflows/pkgdown.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml index d8a0494..e72f067 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - push-to-gh-pages jobs: push-to-gh-pages: @@ -29,7 +28,7 @@ jobs: git clone https://github.com/kss2k/modsem cd modsem/vignettes # make vignettes print their ouptut on the pkgdown site - # ls -A *.Rmd | xargs sed -i "s/EVAL_DEFAULT <- FALSE/EVAL_DEFAULT <- TRUE/" + ls -A *.Rmd | xargs sed -i "s/EVAL_DEFAULT <- FALSE/EVAL_DEFAULT <- TRUE/" cd .. git clone https://github.com/kss2k/modsem --branch pkgdown docs Rscript -e 'pkgdown::build_site(preview = FALSE)' From 65ab50899cb7f2cdfa22fdd8d7382acbe3dfd8a6 Mon Sep 17 00:00:00 2001 From: kss2k Date: Wed, 16 Oct 2024 15:49:04 +0200 Subject: [PATCH 12/12] Renamed workflow for running check and tests --- .github/workflows/{r.yml => check_build.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{r.yml => check_build.yml} (94%) diff --git a/.github/workflows/r.yml b/.github/workflows/check_build.yml similarity index 94% rename from .github/workflows/r.yml rename to .github/workflows/check_build.yml index 62bd606..946cb68 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/check_build.yml @@ -1,4 +1,4 @@ -name: R Package CI +name: Run tests and check (ubuntu) on: push: