From 7af1e851782ce856d23cbcc22606a1b0d105fa56 Mon Sep 17 00:00:00 2001 From: Maksym Bondarenko Date: Wed, 14 Feb 2024 20:28:26 +0000 Subject: [PATCH] Create jekyll-gh-pages.yml --- .github/workflows/jekyll-gh-pages.yml | 62 +++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/jekyll-gh-pages.yml diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml new file mode 100644 index 0000000..468052d --- /dev/null +++ b/.github/workflows/jekyll-gh-pages.yml @@ -0,0 +1,62 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +on: + # Runs on pushes targeting the default branch + push: + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-pandoc@v1 + - name: Install rmarkdown + run: Rscript -e 'install.packages(c("rmarkdown","bookdown"))' + - name: Render Book + run: Rscript -e 'bookdown::render_book("index.Rmd")' + - uses: actions/upload-artifact@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + # Deployment job + deploy: + runs-on: ubuntu-latest + needs: bookdown + steps: + - name: Checkout + uses: actions/checkout@master + - name: Download artifact + uses: actions/download-artifact@v1.0.0 + with: + # Artifact name + name: _book # optional + # Destination path + path: _book # optional + - name: Deploy to GitHub Pages + uses: Cecilapp/GitHub-Pages-deploy@master + env: + EMAIL: ${{ secrets.EMAIL }} # must be a verified email + GH_TOKEN: ${{ secrets.GH_PAT }} # https://github.com/settings/tokens + BUILD_DIR: _book/ # "_site/" by default