This repository has been archived by the owner on Nov 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(github): add github workflow to auto-build schemas
- Loading branch information
Showing
12 changed files
with
161 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
if [[ ! -d "/home/ajgon/Projects/schemas" ]]; then | ||
echo "Cannot find source directory; Did you move it?" | ||
echo "(Looking for "/home/ajgon/Projects/schemas")" | ||
echo 'Cannot force reload with this script - use "direnv reload" manually and then try again' | ||
exit 1 | ||
fi | ||
|
||
# rebuild the cache forcefully | ||
_nix_direnv_force_reload=1 direnv exec "/home/ajgon/Projects/schemas" true | ||
|
||
# Update the mtime for .envrc. | ||
# This will cause direnv to reload again - but without re-building. | ||
touch "/home/ajgon/Projects/schemas/.envrc" | ||
|
||
# Also update the timestamp of whatever profile_rc we have. | ||
# This makes sure that we know we are up to date. | ||
touch -r "/home/ajgon/Projects/schemas/.envrc" "/home/ajgon/Projects/schemas/.direnv"/*.rc |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
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.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
pyyaml |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# yamllint disable rule:comments | ||
--- | ||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
name: "Update schemas" | ||
|
||
'on': workflow_dispatch | ||
|
||
jobs: | ||
render-readme: | ||
name: Update schemas | ||
runs-on: gha-runner-scale-set | ||
steps: | ||
- name: Generate Token | ||
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 | ||
id: generate-token | ||
with: | ||
app_id: "${{ secrets.BOT_APP_ID }}" | ||
private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" | ||
|
||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
token: "${{ steps.generate-token.outputs.token }}" | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' # caching pip dependencies | ||
|
||
- name: Install Requirements | ||
run: | | ||
sudo apt-get update && apt-get install --yes --no-install-recommends git | ||
pip install -r ./.github/scripts/requirements.txt && pip freeze | ||
- name: Setup kubectl | ||
uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f # v4.0.0 | ||
|
||
- name: Refresh schemas | ||
run: | | ||
./.github/scripts/crd-extractor.sh | ||
- name: Commit Changes | ||
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0 | ||
with: | ||
commit_message: "feat: update schemas" | ||
commit_user_name: "RoboDexo2000[bot]" | ||
commit_user_email: "150604236+RoboDexo2000[bot]@users.noreply.github.com" | ||
commit_author: "RoboDexo2000 <150604236+RoboDexo2000[bot]@users.noreply.github.com>" | ||
# yamllint enable rule:comments |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.direnv | ||
.devenv |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
outputs = { self, nixpkgs, flake-utils }: | ||
flake-utils.lib.eachDefaultSystem | ||
(system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
}; | ||
in | ||
{ | ||
devShells.default = pkgs.mkShell { | ||
buildInputs = [ | ||
pkgs.yamllint | ||
]; | ||
}; | ||
} | ||
); | ||
} |