-
-
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.
- Loading branch information
Showing
3 changed files
with
63 additions
and
83 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,33 +1,76 @@ | ||
# Simple workflow for deploying static content to GitHub Pages | ||
name: Deploy docs to GitHub Pages | ||
name: Lint Docs | ||
|
||
on: | ||
# Runs on pushes targeting the default branch and docs path | ||
push: | ||
branches: ['main'] | ||
paths-ignore: ['**/*.yml', '!**/docs.yml'] | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
paths: ['**/*.md', '**/docs.yml'] | ||
pull_request: | ||
|
||
# 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 | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
REPO_NAME: ${{ github.event.repository.name }} | ||
MOD_PATH: ~/.vmodules/vibe/ | ||
|
||
jobs: | ||
# Single deploy job since we're just deploying | ||
debounce: | ||
runs-on: ubuntu-latest | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
outputs: | ||
abort: ${{ steps.debounce.outputs.abort }} | ||
steps: | ||
- name: Debounce | ||
if: github.ref_name != 'main' && github.event_name == 'push' | ||
id: debounce | ||
run: | | ||
pr_branches=$(gh pr list --json headRefName --repo $GITHUB_REPOSITORY) | ||
if [[ $(echo "$pr_branches" | jq -r --arg GITHUB_REF '.[].headRefName | select(. == $GITHUB_REF)') ]]; then | ||
echo "This push is associated with a pull request. Skipping the job." | ||
echo "abort=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
check-docs: | ||
runs-on: ubuntu-latest | ||
needs: debounce | ||
if: needs.debounce.outputs.abort != 'true' | ||
steps: | ||
- name: Restore Cache | ||
id: cache-status | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
vlang | ||
~/.vmodules | ||
key: ${{ runner.os }}-${{ github.sha }} | ||
- name: Setup V | ||
uses: vlang/[email protected] | ||
- name: Setup Dependencies | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: libcurl4-openssl-dev | ||
version: 1.0 | ||
- name: Checkout ${{ env.REPO_NAME }} | ||
if: ${{ steps.cache-status.outputs.cache-hit != 'true' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ${{ env.REPO_NAME }} | ||
- name: Copy ${{ env.REPO_NAME }} to .vmodules | ||
if: ${{ steps.cache-status.outputs.cache-hit != 'true' }} | ||
run: cp -r ${{ env.REPO_NAME }} ${{ env.MOD_PATH }} | ||
- name: Check Markdown | ||
run: v check-md -hide-warnings ${{ env.MOD_PATH }} | ||
|
||
deploy: | ||
concurrency: | ||
group: pages | ||
cancel-in-progress: false | ||
runs-on: ubuntu-latest | ||
if: github.ref_name == 'main' && github.event_name == 'push' | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
|
This file was deleted.
Oops, something went wrong.