forked from VirtusLab/jenkins-operator
-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ingress-jenkins
- Loading branch information
Showing
26 changed files
with
1,185 additions
and
597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: codespell | ||
name: CI Lint | ||
on: | ||
push: | ||
branches: | ||
|
@@ -8,14 +8,26 @@ on: | |
types: [opened, synchronize, ready_for_review, reopened] | ||
jobs: | ||
codespell: | ||
name: codespell | ||
name: Codespell | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Codespell | ||
uses: codespell-project/actions-codespell@v2 | ||
with: | ||
check_filenames: true | ||
ignore_words_list: aks,ags,startin | ||
skip: "*.js,package-lock.json,*.lock,*/Font-Awesome/*,*.toml,*.svg,*assets/vendor/bootstrap*,cert-manager.crds.yaml" | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Codespell | ||
uses: codespell-project/actions-codespell@v2 | ||
with: | ||
check_filenames: true | ||
ignore_words_list: aks,ags,startin | ||
skip: "*.js,package-lock.json,*.lock,*/Font-Awesome/*,*.toml,*.svg,*assets/vendor/bootstrap*,cert-manager.crds.yaml" | ||
pre-commit: | ||
name: PreCommit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- id: files | ||
uses: tj-actions/changed-files@v42 | ||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --files ${{ steps.files.outputs.all_changed_files }} --show-diff-on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,105 @@ | ||
name: auto-generate-docs | ||
name: Website | ||
|
||
# Run this workflow every time a new commit pushed to your repository | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
paths: | ||
- 'docs/**' | ||
- 'website/**' | ||
- 'assets/**' | ||
pull_request: | ||
types: [opened, synchronize, ready_for_review, reopened] | ||
paths: | ||
- 'website/**' | ||
- 'assets/**' | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "website" | ||
cancel-in-progress: false | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
# Set the job key. The key is displayed as the job name | ||
# when a job name is not provided | ||
docs: | ||
# Name the Job | ||
name: auto-generate-docs | ||
# Set the type of machine to run on | ||
update-date: | ||
name: Auto update dates | ||
runs-on: ubuntu-latest | ||
|
||
if: github.event_name == 'pull_request' || (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') | ||
steps: | ||
# Checks out a copy of your repository on the ubuntu-latest machine | ||
- uses: DeterminateSystems/nix-installer-action@v9 | ||
with: | ||
diagnostic-endpoint: "" | ||
- uses: DeterminateSystems/magic-nix-cache-action@v3 | ||
with: | ||
diagnostic-endpoint: "" | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive # Fetch the Docsy theme | ||
fetch-depth: 0 | ||
|
||
# Checks if the previous commit introduced any changes to website files | ||
- name: Check for changes | ||
run: | | ||
IS_CHANGED=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -Ec "^website*" || :) | ||
[[ $IS_CHANGED -gt 0 ]] && echo "IS_CHANGED=true" >> $GITHUB_ENV || echo "IS_CHANGED=false" >> $GITHUB_ENV | ||
# Sets up the appropriate version of Hugo | ||
- name: Setup Hugo | ||
if: env.IS_CHANGED == 'true' | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: '0.113.0' | ||
extended: true | ||
|
||
# Sets up node - required by Hugo | ||
- name: Setup Node | ||
if: env.IS_CHANGED == 'true' | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '12.x' | ||
|
||
# Installs dependencies required by docsy theme | ||
- name: Install docsy dependencies | ||
if: env.IS_CHANGED == 'true' | ||
run: | | ||
cd website | ||
npm install | ||
npm build | ||
sudo npm install -D --save autoprefixer | ||
sudo npm install -D --save postcss-cli | ||
cd ../ | ||
- name: Update last modified date in modified docs | ||
if: env.IS_CHANGED == 'true' | ||
run: | | ||
git diff --name-only --diff-filter=d ${{ github.event.before }} ${{ github.sha }} | grep -E "^website*" \ | ||
| sed -e 's/\(.*\)/"\1"/' | xargs sed -i "/date:/c\date: $(date +'%Y-%m-%d')" | ||
# Runs makefile goal - checks changes to /website folder and generates docs | ||
- name: Run Makefile goal | ||
if: env.IS_CHANGED == 'true' | ||
env: | ||
DEFAULT_BRANCH: master | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: make generate-docs | ||
|
||
# Creates pull request with generated docs | ||
- name: Create Pull Request | ||
if: env.IS_CHANGED == 'true' | ||
uses: peter-evans/create-pull-request@v6 | ||
if: env.IS_CHANGED == 'true' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') | ||
with: | ||
commit-message: Auto-updated docs | ||
branch: docs-generator | ||
title: Auto-generated docs update | ||
body: | | ||
Auto generated docs from master commit ${{ github.sha }} | ||
website-generate: | ||
name: Auto generate website | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' || (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') | ||
steps: | ||
- uses: DeterminateSystems/nix-installer-action@v9 | ||
with: | ||
diagnostic-endpoint: "" | ||
- uses: DeterminateSystems/magic-nix-cache-action@v3 | ||
with: | ||
diagnostic-endpoint: "" | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: nix checks | ||
run: nix flake check | ||
- name: nix build | ||
env: | ||
HUGO_ENVIRONMENT: production | ||
HUGO_ENV: production | ||
run: nix build .#website | ||
- name: Setup Pages | ||
id: pages | ||
uses: actions/configure-pages@v4 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ./result | ||
|
||
website-deploy: | ||
name: Deploy website | ||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: website-generate | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.