From 58d1cc64bd2ae9877a2ca395d6a423d1a35bc4aa Mon Sep 17 00:00:00 2001 From: Ralph Hightower <32745442+RalphHightower@users.noreply.github.com> Date: Mon, 30 Dec 2024 23:47:07 -0500 Subject: [PATCH] [setup](build): base workflows (#53) * [setup](build): base workflows * [setup](sec): codeql.yml * [setup](build): codeql.yml * [setup](web): Ruby Gemfile * [cleanup](build): jekyll_ai_related_posts-0.1.4.gem --- .github/workflows/GitHubActionPermissions.md | 24 +++++++ .github/workflows/ci.yaml | 4 +- .github/workflows/codeql.yml | 8 +-- .github/workflows/jekyll.yml | 66 ++++++++++++++++++++ .github/workflows/permission_advisor.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/scorecard.yml | 6 +- .github/workflows/test.yml | 2 +- .github/workflows/workflows.md | 31 +++++++++ Gemfile | 3 +- 10 files changed, 135 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/GitHubActionPermissions.md create mode 100644 .github/workflows/jekyll.yml create mode 100644 .github/workflows/workflows.md diff --git a/.github/workflows/GitHubActionPermissions.md b/.github/workflows/GitHubActionPermissions.md new file mode 100644 index 0000000..1ce9350 --- /dev/null +++ b/.github/workflows/GitHubActionPermissions.md @@ -0,0 +1,24 @@ +--- +layout: post +tags: [] +categories: [] +#date: 2019-06-25 13:14:15 +#excerpt: '' +#image: 'BASEURL/assets/blog/img/.png' +#description: +#permalink: +title: 'title' +--- + + +permissions: + actions: read|write|none + checks: read|write|none + contents: read|write|none + deployments: read|write|none + issues: read|write|none + packages: read|write|none + pull-requests: read|write|none + repository-projects: read|write|none + security-events: read|write|none + statuses: read|write|noner \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5090123..f238b27 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,14 +15,14 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - jekyll: ["~> 3.9", "~> 4.2"] + jekyll: ["~> 4.3.4"] env: JEKYLL_VERSION: ${{ matrix.jekyll }} steps: - name: Checkout Repository uses: actions/checkout@v4.2.2 - name: Set Up Ruby 3.3.6 - uses: ruby/setup-ruby@v1.202.0 + uses: ruby/setup-ruby@v1.206.0 with: ruby-version: 3.3.6 bundler-cache: true diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 031f793..8995389 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -35,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - language: ["ruby"] + language: ["ruby","C#"] # CodeQL supports [ $supported-codeql-languages ] # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support @@ -45,7 +45,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/autobuild@v2.19.3 + uses: github/codeql-action/autobuild@v2.20.0 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -55,7 +55,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v3.27.4 + uses: github/codeql-action/autobuild@v2.20.0 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -68,6 +68,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2.19.3 + uses: github/codeql-action/analyze@v2.20.0 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml new file mode 100644 index 0000000..adc66b1 --- /dev/null +++ b/.github/workflows/jekyll.yml @@ -0,0 +1,66 @@ +# 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: jekyll.yml – Deploy Jekyll site to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main", "_staging", "next"] + + # 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: + - name: Checkout + uses: actions/checkout@v4.2.2 + - name: Setup Ruby + uses: ruby/setup-ruby@v1.206.0 + with: + ruby-version: '3.3.6' # Not needed with a .ruby-version file + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + cache-version: 1 # Increment this number if you need to re-download cached gems + - name: Setup Pages + id: pages + uses: actions/configure-pages@v5.0.0 + - name: Build with Jekyll + # Outputs to the './_site' directory by default + run: bundle exec jekyll build --trace --incremental --baseurl "${{ steps.pages.outputs.base_path }}" + env: + JEKYLL_ENV: production + JEKYLL_GITHUB_TOKEN: ${{secrets.JEKYLL_METADATA_TOKEN}} + LOG_LEVEL: debug + - name: Upload artifact + # Automatically uploads an artifact from the './_site' directory by default + uses: actions/upload-pages-artifact@v3.0.1 + + # 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.0.5 diff --git a/.github/workflows/permission_advisor.yml b/.github/workflows/permission_advisor.yml index 9c00c37..79ee96a 100644 --- a/.github/workflows/permission_advisor.yml +++ b/.github/workflows/permission_advisor.yml @@ -21,7 +21,7 @@ jobs: advisor: runs-on: ubuntu-latest steps: - - uses: GitHubSecurityLab/actions-permissions/advisor@v1.0.2-beta4 + - uses: GitHubSecurityLab/actions-permissions/advisor@v1.0.2-beta5 with: name: ${{ inputs.name }} count: ${{ inputs.count }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1de2b14..ffc8367 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: release.yml – Release on: push: branches: - - master + - main - next - beta - "*.x" diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 9c84fa1..9fb46bd 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -4,7 +4,7 @@ name: scorecard.yml — OpenSSF Scorecard - cron: 31 2 * * 1 push: branches: - - master + - main permissions: read-all jobs: analysis: @@ -31,6 +31,6 @@ jobs: path: results.sarif retention-days: 5 - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@v2.19.3 + uses: github/codeql-action/upload-sarif@v2.20.0 with: - sarif_file: results.sarif + sarif_file: results.sarif \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb0258a..d1cf261 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: test.yml — Test on: push: branches: - - master + - main # renovate/** branches are generated by https://github.com/apps/renovate - renovate/** diff --git a/.github/workflows/workflows.md b/.github/workflows/workflows.md new file mode 100644 index 0000000..c3d35ab --- /dev/null +++ b/.github/workflows/workflows.md @@ -0,0 +1,31 @@ +--- +layout: page +title: GitHub Workflows +#permalink: /Astronomy/ +--- + +## Revision Date: 2024-12-27 2:31 PM + +| action | date | github | +|---|---|---| +| DavidAnson/markdownlint-cli2-action@v18.0.0 | Nov 14, 2024 |[DavidAnson/markdownlint-cli2-action: A GitHub Action to run the markdownlint-cli2 tool for linting Markdown/CommonMark files with the markdownlint library](https://github.com/DavidAnson/markdownlint-cli2-action) | +| GitHubSecurityLab/actions-permissions/advisor@v1.0.2-beta5 | Dec 19, 2024 | [GitHubSecurityLab/actions-permissions: GitHub token permissions Monitor and Advisor actions](https://github.com/GitHubSecurityLab/actions-permissions) | +| actions/checkout@v4.2.2 | Oct 23, 2024 | [actions/checkout: Action for checking out a repo](https://github.com/actions/checkout) | +| actions/configure-pages@v5.0.0 | Mar 29, 2024 | [actions/configure-pages: An action to enable Pages and extract various metadata about a site. It can also be used to configure various static site generators we support as starter workflows.](https://github.com/actions/configure-pages) | +| actions/dependency-review-action@v4.5.0 | Nov 20, 2024 | [actions/dependency-review-action: A GitHub Action for detecting vulnerable dependencies and invalid licenses in your PRs](https://github.com/actions/dependency-review-action) | +| actions/deploy-pages@4.0.5 | Mar 18, 2024 | [actions/deploy-pages: GitHub Action to publish artifacts to GitHub Pages for deployments](https://github.com/actions/deploy-pages) | +| actions/jekyll-build-pages@v1.0.13 | Aug 6, 2024 | [actions/jekyll-build-pages: A simple GitHub Action for producing Jekyll build artifacts compatible with GitHub Pages.](https://github.com/actions/jekyll-build-pages) | +| actions/setup-node@v4.1.0 | Oct 24, 2024 | [actions/setup-node: Set up your GitHub Actions workflow with a specific version of node.js](https://github.com/actions/setup-node) | +| actions/upload-artifact@v4.5.0 | Dec 19, 2024 | [actions/upload-artifact](https://github.com/actions/upload-artifact) | +| actions/upload-pages-artifact@v3.0.1 | Feb 7, 2024 | [actions/upload-pages-artifact: A composite action for packaging and uploading an artifact that can be deployed to GitHub Pages.](https://github.com/actions/upload-pages-artifact) | +| amannn/action-semantic-pull-request@v5.5.3 | Jun 28, 2024 | [amannn/action-semantic-pull-request: A GitHub Action that ensures that your PR title matches the Conventional Commits spec](https://github.com/amannn/action-semantic-pull-request) | +| github/codeql-action/analyze@v2.20.0 | Dec 12, 2024 | [github/codeql-action: Actions for running CodeQL analysis](https://github.com/github/codeql-action) | +| github/codeql-action/autobuild@v2.20.0 | Dec 12, 2024 | [github/codeql-action: Actions for running CodeQL analysis](https://github.com/github/codeql-action) | +| github/codeql-action/init@v2.20.0 | Dec 12, 2024 | [github/codeql-action: Actions for running CodeQL analysis](https://github.com/github/codeql-action) | +| github/codeql-action/upload-sarif@v2.20.0 | Dec 12, 2024 | [github/codeql-action: Actions for running CodeQL analysis](https://github.com/github/codeql-action) | +| googleapis/release-please-action@4.1.3 | Jun 10, 2024 | [googleapis/release-please-action: automated releases based on conventional commits](https://github.com/googleapis/release-please-action) +| googleapis/release-please@v16.15.0 | Dec 2, 2024 | [googleapis/release-please: generate release PRs based on the conventionalcommits.org spec](https://github.com/googleapis/release-please) | +| lowlighter/metrics@3.34 | Sep 12, 2023 | [lowlighter/metrics: 📊 An infographics generator with 30+ plugins and 300+ options to display stats about your GitHub account and render them as SVG, Markdown, PDF or JSON!](https://github.com/lowlighter/metrics) | +| ossf/scorecard-action@v2.4.0 | Jul 26, 2024 | [ossf/scorecard-action: Official GitHub Action for OpenSSF Scorecard.](https://github.com/ossf/scorecard-action) | +| ruby/setup-ruby@v1.206.0 | Dec 26, 2024 | [ruby/setup-ruby: An action to download a prebuilt Ruby and add it to the PATH in 5 seconds](https://github.com/ruby/setup-ruby) | +| step-security/harden-runner@v2.10.2 | Nov 18, 2024 | [step-security/harden-runner: Network egress filtering and runtime security for GitHub-hosted and self-hosted runners](https://github.com/step-security/harden-runner) | diff --git a/Gemfile b/Gemfile index d2472e7..ff90876 100644 --- a/Gemfile +++ b/Gemfile @@ -28,6 +28,7 @@ gem 'jekyll-github-metadata', '~> 2.16', '>= 2.16.1' gem 'jekyll-last-modified-at', '~> 1.3', '>= 1.3.2' gem 'jekyll-mentions', '~> 1.6' gem 'jekyll-optional-front-matter', '~> 0.3.2' +gem 'jekyll-paginate', '~> 1.1' gem 'jekyll-readme-index', '~> 0.3.0' gem 'jekyll-relative-links', '~> 0.7.0' gem 'jekyll-seo-tag', '~> 2.8' @@ -45,4 +46,4 @@ gem 'base64', '~> 0.2.0' # { 2024-10-29 @RalphHightower gem 'nuggets', '~> 1.6', '>= 1.6.1' # } 2024-10-29 @RalphHightower -end \ No newline at end of file +end