forked from aklivity/zilla-docs
-
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
141 changed files
with
10,833 additions
and
3,017 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,10 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[{package.json,*.yml,*.md}] | ||
indent_style = space | ||
indent_size = 2 |
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,165 @@ | ||
name: Site versioned build & deploy | ||
|
||
on: | ||
push: | ||
branches: [develop, feature/vuepress-rewrite] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
deployments: write | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
env: | ||
DistDir: dist | ||
BuildDir: build | ||
SITE_BASE: ${{ vars.SITE_BASE }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Restore cached Docs | ||
id: dist-cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: ${{ env.DistDir }} | ||
key: ${{ env.DistDir }}-${{ hashFiles('deploy-versions.json') }} | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: pnpm | ||
|
||
- name: build versions.json | ||
run: jq -rc '. + input' "src/.vuepress/versions.json" deploy-versions.json > versions.json; | ||
|
||
- if: ${{ steps.dist-cache.outputs.cache-hit != 'true' }} | ||
name: Pull versions | ||
run: | | ||
for row in $(jq -rc '.[]' deploy-versions.json); do | ||
key=$(echo ${row} | jq -r '.key'); | ||
tag=$(echo ${row} | jq -r '.tag'); | ||
gh release download "$tag" --archive=tar.gz --output "$tag.tar.gz" --skip-existing; | ||
mkdir -p "$BuildDir/$key"; | ||
tar -xvf "$tag.tar.gz" -C "$BuildDir/$key" --strip-components 1; | ||
cp versions.json "$BuildDir/$key/src/.vuepress/versions.json"; | ||
done | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- if: ${{ steps.dist-cache.outputs.cache-hit != 'true' }} | ||
name: Build versions | ||
env: | ||
NODE_OPTIONS: "--max_old_space_size=4096" | ||
run: | | ||
wrkdir=$(pwd); | ||
for row in $(jq -rc '.[]' deploy-versions.json); do | ||
key=$(echo ${row} | jq -r '.key'); | ||
export DIST_DIR="$wrkdir/$DistDir"; | ||
export SITE_VERSION_KEY="$key"; | ||
mkdir -p "$DIST_DIR"; | ||
cd "$BuildDir/$key"; | ||
pnpm install && pnpm build; | ||
cd $wrkdir; | ||
done | ||
- name: Build VuePress site | ||
env: | ||
NODE_OPTIONS: "--max_old_space_size=4096" | ||
SITE_VERSION_KEY: next | ||
run: | | ||
cp versions.json "src/.vuepress/versions.json"; | ||
export DIST_DIR="$(pwd)/$DistDir"; | ||
pnpm build | ||
- if: ${{ steps.dist-cache.outputs.cache-hit != 'true' }} | ||
name: Save Docs | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: ${{ env.DistDir }} | ||
key: ${{ env.DistDir }}-${{ hashFiles('deploy-versions.json') }} | ||
|
||
- name: Upload cloudflare-pages artifact | ||
if: github.repository_owner == 'aklivity' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: cloudflare-pages | ||
path: ${{ env.DistDir }} | ||
|
||
- name: Upload github-pages artifact | ||
if: github.repository_owner != 'aklivity' | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: ${{ env.DistDir }}/zilla-docs | ||
|
||
deployCloudflarePages: | ||
if: github.repository_owner == 'aklivity' | ||
runs-on: ubuntu-latest | ||
needs: build | ||
permissions: | ||
contents: read | ||
deployments: write | ||
|
||
environment: | ||
name: cloudflare-pages | ||
url: ${{ steps.cloudflare-deployment.outputs.url }} | ||
|
||
steps: | ||
- name: Download cloudflare-pages artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: cloudflare-pages | ||
path: ${{ env.DistDir }} | ||
|
||
- name: Move cloudflare files to root | ||
run: mv ${{ env.DistDir }}/${{ env.SITE_BASE }}/next/cloudflare/* ${{ env.DistDir }} | ||
|
||
- name: Publish to Cloudflare Pages | ||
id: cloudflare-deployment | ||
uses: cloudflare/pages-action@v1 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: 65fb75109b09718cddae9ab7c68e2e3c | ||
projectName: zilla-docs | ||
directory: ${{ env.DistDir }} | ||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
deployGithubPages: | ||
if: github.repository_owner != 'aklivity' | ||
runs-on: ubuntu-latest | ||
needs: build | ||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.github-deployment.outputs.page_url }}next | ||
|
||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: github-deployment | ||
uses: actions/deploy-pages@v2 |
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,41 @@ | ||
name: Links check build | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
linkChecker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
run_install: true | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: pnpm | ||
|
||
- name: Build VuePress site | ||
env: | ||
NODE_OPTIONS: "--max_old_space_size=4096" | ||
run: | | ||
pnpm build | ||
- name: Anchor tag Checker | ||
run: | | ||
pnpm install -g link-checker | ||
link-checker src/.vuepress/dist | ||
- name: Link Checker | ||
uses: lycheeverse/[email protected] | ||
with: | ||
fail: true | ||
args: --exclude="github.com" --exclude="docs.aklivity.io" --exclude-mail --base="src/.vuepress/dist" src/.vuepress/dist | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
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,18 @@ | ||
name: Links check src | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
linkChecker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Link Checker | ||
uses: lycheeverse/[email protected] | ||
with: | ||
fail: true | ||
args: --exclude-mail src | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
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,5 @@ | ||
|
||
node_modules/ | ||
dist | ||
src/.vuepress/.cache/ | ||
src/.vuepress/.temp/ |
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,5 @@ | ||
{ | ||
"allow-hash-href": true, | ||
"disable-external": true, | ||
"url-ignore": [".+zilla-docs\/.+"] | ||
} |
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,4 @@ | ||
{ | ||
"MD013": false, | ||
"MD051": false | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.