From 0a2348aeb706da7f6345eb702e7d5efd0455a0ad Mon Sep 17 00:00:00 2001 From: Sonu Kumar Date: Tue, 9 Jul 2024 08:22:14 +0530 Subject: [PATCH 1/4] github page --- .github/workflows/ci.yaml | 22 ++++++++++++ .github/workflows/pages.yaml | 70 ++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/pages.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..fd45c9ea --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,22 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' # Not needed with a .ruby-version file + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + cache-version: 0 # Increment this number if you need to re-download cached gems + - name: Build with Jekyll + run: bundle exec jekyll build \ No newline at end of file diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml new file mode 100644 index 00000000..e03ac976 --- /dev/null +++ b/.github/workflows/pages.yaml @@ -0,0 +1,70 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll site to Pages + +on: + push: + branches: [$default-branch] + + # 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 one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' # Not needed with a .ruby-version file + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + cache-version: 0 # Increment this number if you need to re-download cached gems + - name: Setup Pages + id: pages + uses: actions/configure-pages@v5 + - name: Build with Jekyll + + # Outputs to the './_site' directory by default + run: + | + cd docs + bundle install + bundle exec jekyll build + mkdir -p _site + env: + JEKYLL_ENV: production + - name: Upload artifact + # Automatically uploads an artifact from the './_site' directory by default + uses: actions/upload-pages-artifact@v3 + with: + path: docs/_site + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file From 7045a465a5dcad77caeadc6f746346398d744274 Mon Sep 17 00:00:00 2001 From: Sonu Kumar Date: Tue, 9 Jul 2024 08:27:25 +0530 Subject: [PATCH 2/4] run on pull --- .github/workflows/pages.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index e03ac976..2cb1acea 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -9,8 +9,9 @@ name: Deploy Jekyll site to Pages on: push: branches: [$default-branch] - - # Allows you to run this workflow manually from the Actions tab + pull_request: + branches: [ 'main', '2.x' ] + # 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 From 865d7f88c84b7ceac328dfad60e8d6b469b5721a Mon Sep 17 00:00:00 2001 From: Sonu Kumar Date: Tue, 9 Jul 2024 08:30:04 +0530 Subject: [PATCH 3/4] use pages file only --- .github/workflows/ci.yaml | 22 ------------ .github/workflows/pages.yaml | 66 ++++++++++++++++++------------------ 2 files changed, 33 insertions(+), 55 deletions(-) delete mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index fd45c9ea..00000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: CI - -on: - push: - branches: ["main"] - pull_request: - -jobs: - # Build job - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.3' # Not needed with a .ruby-version file - bundler-cache: true # runs 'bundle install' and caches installed gems automatically - cache-version: 0 # Increment this number if you need to re-download cached gems - - name: Build with Jekyll - run: bundle exec jekyll build \ No newline at end of file diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 2cb1acea..9dcd88e6 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -7,65 +7,65 @@ name: Deploy Jekyll site to Pages on: + # Runs on pushes targeting the default branch push: - branches: [$default-branch] - pull_request: - branches: [ 'main', '2.x' ] - # Allows you to run this workflow manually from the Actions tab + branches: [ $default-branch ] + + # 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 + contents: write pages: write id-token: write -# Allow one concurrent deployment +# 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: true + cancel-in-progress: false jobs: - # Build job - build: + # Build and Deploy job + build_and_deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@v1 # Update to latest version as needed with: - ruby-version: '3.3' # Not needed with a .ruby-version file + ruby-version: '3.1' # Not needed with a .ruby-version file bundler-cache: true # runs 'bundle install' and caches installed gems automatically cache-version: 0 # Increment this number if you need to re-download cached gems - - name: Setup Pages - id: pages - uses: actions/configure-pages@v5 - - name: Build with Jekyll - - # Outputs to the './_site' directory by default - run: - | + - name: Bundle install in docs folder + run: | cd docs bundle install - bundle exec jekyll build - mkdir -p _site + - name: Build Jekyll site + run: | + cd docs + bundle exec jekyll build --baseurl /rqueue + mkdir -p _site # Ensure _site directory exists env: JEKYLL_ENV: production + - name: Verify _site directory + run: | + cd docs + ls -l _site - name: Upload artifact # Automatically uploads an artifact from the './_site' directory by default - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-artifact@v2 with: + name: Jekyll site path: docs/_site - - # Deployment job - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file + uses: JamesIves/github-pages-deploy-action@4.1.4 # Replace with the appropriate deploy action + with: + branch: $default-branch + folder: docs/_site + cname: sonus21.github.io + env: + JEKYLL_ENV: production + BASE_URL: /rqueue \ No newline at end of file From cfb556f0fc0e83e590083a3ce410a2ab30cfcd0f Mon Sep 17 00:00:00 2001 From: Sonu Kumar Date: Tue, 9 Jul 2024 08:34:28 +0530 Subject: [PATCH 4/4] pr --- .github/workflows/pages.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml index 9dcd88e6..d8986797 100644 --- a/.github/workflows/pages.yaml +++ b/.github/workflows/pages.yaml @@ -10,6 +10,9 @@ on: # Runs on pushes targeting the default branch push: branches: [ $default-branch ] + pull_request: + branches: [ 'main', '2.x' ] + types: [ opened ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: