-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from DefangLabs/prebuild
Prebuild script
- Loading branch information
Showing
6 changed files
with
40 additions
and
34 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 |
---|---|---|
|
@@ -59,18 +59,8 @@ jobs: | |
with: | ||
go-version: "1.21" | ||
|
||
- name: Generate CLI docs | ||
run: go run main.go ./tmp | ||
working-directory: defang/src/cmd/gendocs | ||
|
||
- name: Copy CLI docs to current repository | ||
run: cp -r ./defang/src/cmd/gendocs/tmp/* ./docs/cli | ||
|
||
- name: Prep CLI docs | ||
run: npm run prep-cli-docs | ||
|
||
- name: Prep Samples | ||
run: npm run prep-samples | ||
- name: Pre-build | ||
run: npm run prebuild | ||
|
||
- name: Build website | ||
run: npm run build | ||
|
@@ -92,6 +82,7 @@ jobs: | |
user_email: 41898282+github-actions[bot]@users.noreply.github.com | ||
cname: docs.defang.io | ||
|
||
|
||
- name: Notify Slack of Action Failures | ||
uses: ravsamhq/[email protected] | ||
if: ${{ always() && github.ref_name == 'main' }} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
CWD=$(pwd) | ||
CLI_DOCS_PATH=$(readlink -f docs/cli) | ||
|
||
# In CI (github actions), the defang and samples repositories must be cloned | ||
# into the working directory of the `defang-docs` repository. | ||
# In local development, however, the defang and samples repositories are cloned | ||
# into the parent directory of the `defang-docs` repository. | ||
if [ -d "../defang" ]; then | ||
DEFANG_PATH=$(readlink -f ../defang) | ||
else | ||
DEFANG_PATH=$(readlink -f ./defang) | ||
fi | ||
if [ -d "../samples" ]; then | ||
SAMPLES_PATH=$(readlink -f ../samples) | ||
else | ||
SAMPLES_PATH=$(readlink -f ./samples) | ||
fi | ||
|
||
cd "$DEFANG_PATH/src/cmd/gendocs" && go run main.go "$CLI_DOCS_PATH" | ||
cd "$CWD" | ||
node scripts/prep-cli-docs.js | ||
node scripts/prep-samples.js "$SAMPLES_PATH/samples" |
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 |
---|---|---|
|
@@ -47,4 +47,4 @@ fs.readdirSync(directoryPath).forEach(file => { | |
|
||
fs.writeFileSync(filePath, fileContent); | ||
} | ||
}); | ||
}); |
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