forked from uw-psych/hyakvnc
-
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.
Build README.md via GitHub Action (#6)
* Put README generation in GitHub Action
- Loading branch information
Showing
4 changed files
with
51 additions
and
45 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -78,7 +78,7 @@ ssh [email protected] | |
After you've connected to the login node, you can download and install `hyakvnc` by running the following command. Copy and paste it into the terminal window where you are connected to the login node and press enter: | ||
|
||
```bash | ||
curl -o ~/.local/bin/hyakvnc --create-dirs -fsSL https://raw.githubusercontent.com/{{ repo_name }}/main/hyakvnc && chmod +x ~/.local/bin/hyakvnc && [[ ":${PATH}:" != *":$HOME/.local/bin:"* ]] && export PATH="$HOME/.local/bin:$PATH" && [-n "${ZSH_VERSION:-}" ] && rehash | ||
curl -o ~/.local/bin/hyakvnc --create-dirs -fsSL https://raw.githubusercontent.com/{{github_repository}}/{{github_ref_name}}/hyakvnc && chmod +x ~/.local/bin/hyakvnc && [[ ":${PATH}:" != *":$HOME/.local/bin:"* ]] && export PATH="$HOME/.local/bin:$PATH" && [-n "${ZSH_VERSION:-}" ] && rehash | ||
``` | ||
|
||
This will download and install `hyakvnc` to your `~/.local/bin` directory and add it to your `$PATH` so you can run it by typing `hyakvnc` into the terminal window. | ||
|
@@ -88,7 +88,7 @@ This will download and install `hyakvnc` to your `~/.local/bin` directory and ad | |
In a terminal window connected to a login node, enter this command to clone the repository and navigate into the repository directory: | ||
|
||
```bash | ||
git clone {{ repo_url }} && cd hyakvnc | ||
git clone https://github.com/{{github_repository}} && cd hyakvnc | ||
``` | ||
|
||
Then, run the following command to install `hyakvnc`: | ||
|
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,46 @@ | ||
name: Build documentation | ||
"on": | ||
push: | ||
|
||
jobs: | ||
build-readme: | ||
runs-on: ubuntu-latest | ||
name: Build README.md | ||
permissions: write-all | ||
steps: | ||
- name: Install jinja-cli | ||
run: | | ||
python3 -m pip install jinja-cli | ||
- name: Check out code for the container build | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Check if README.md has changed | ||
id: readme-changed | ||
run: | | ||
if git --no-pager diff --name-only --quiet --diff-filter=AM ${{ github.event.before }} ${{ github.event.after }} -- hyakvnc .build/README.j2.md .github/workflows/mkreadme.yml; then | ||
gh run cancel ${{ github.run_id }} | ||
gh run watch ${{ github.run_id }} | ||
fi | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Generate configuration descriptions | ||
run: | | ||
pushd .build/ | ||
sed -E '/^HYAKVNC_.*#\s*%%/!d; s/=.*(#\s*%%)/:/g; s/(^.)/- \1/g' ../hyakvnc > config.inc.md | ||
popd | ||
- name: Generate usage descriptions | ||
run: | | ||
pushd .build/ | ||
for x in create status show stop config install; do ../hyakvnc help "$x" | sed -E '1 s/(.*)/\n### \1\n/; 2 s/^$/```text/' | pr -e4 -t && echo '```'; done > usage.inc.md | ||
popd | ||
- name: Create and push README.md | ||
run: | | ||
pushd .build/ | ||
jinja -D github_repository "${{ github.repository }}" -D github_ref_name "${{ github.ref_name }}" README.j2.md | sed 's/^.*<!-- markdownlint-disable-file -->.*$//g' > ../README.md | ||
popd | ||
git config --local user.email "${{ github.event.sender.id }}+${{ github.event.sender.login }}@users.noreply.github.com" | ||
git config --local user.name ${{ github.event.sender.login }} | ||
git add README.md | ||
git commit -am "Update README.md" | ||
git push |
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 |
---|---|---|
|
@@ -78,7 +78,7 @@ ssh [email protected] | |
After you've connected to the login node, you can download and install `hyakvnc` by running the following command. Copy and paste it into the terminal window where you are connected to the login node and press enter: | ||
|
||
```bash | ||
curl -o ~/.local/bin/hyakvnc --create-dirs -fsSL https://raw.githubusercontent.com/maouw/hyakvnc/main/hyakvnc && chmod +x ~/.local/bin/hyakvnc && [[ ":${PATH}:" != *":$HOME/.local/bin:"* ]] && export PATH="$HOME/.local/bin:$PATH" && [-n "${ZSH_VERSION:-}" ] && rehash | ||
curl -o ~/.local/bin/hyakvnc --create-dirs -fsSL https://raw.githubusercontent.com/maouw/hyakvnc/mkreadme-gha/hyakvnc && chmod +x ~/.local/bin/hyakvnc && [[ ":${PATH}:" != *":$HOME/.local/bin:"* ]] && export PATH="$HOME/.local/bin:$PATH" && [-n "${ZSH_VERSION:-}" ] && rehash | ||
``` | ||
|
||
This will download and install `hyakvnc` to your `~/.local/bin` directory and add it to your `$PATH` so you can run it by typing `hyakvnc` into the terminal window. | ||
|
@@ -245,7 +245,7 @@ Examples: | |
Usage: hyakvnc config [config options...] | ||
Description: | ||
Show the current configuration for hyakvnc, as set in the user configuration file at /home/altan/.hyakvnc/hyakvnc-config.env, in the current environment, or the default values set by hyakvnc. | ||
Show the current configuration for hyakvnc, as set in the user configuration file at /home/runner/.hyakvnc/hyakvnc-config.env, in the current environment, or the default values set by hyakvnc. | ||
Options: | ||
-h, --help Show this help message and exit | ||
|
@@ -291,6 +291,7 @@ When you set an environment variable, it is advisable to surround the value with | |
The following variables are available: | ||
|
||
- HYAKVNC_DIR: Local directory to store application data (default: `$HOME/.hyakvnc`) | ||
- HYAKVNC_CHECK_UPDATE_FREQUENCY: How often to check for updates in `[d]`ays or `[m]`inutes (default: `0` for every time. Use `1d` for daily, `10m` for every 10 minutes, etc. `-1` to disable.) | ||
- HYAKVNC_CONFIG_FILE: Configuration file to use (default: `$HYAKVNC_DIR/hyakvnc-config.env`) | ||
- HYAKVNC_LOG_FILE: Log file to use (default: `$HYAKVNC_DIR/hyakvnc.log`) | ||
- HYAKVNC_LOG_LEVEL: Log level to use for interactive output (default: `INFO`) | ||
|