-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-admonition-in-browsing-security-art…
…icle
- Loading branch information
Showing
8 changed files
with
90 additions
and
8,910 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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
name: Build and deploy | ||
|
||
env: | ||
NODE_VERSION: 20 | ||
BASE_DOMAIN: kb-adg.pages.dev | ||
BASE_PATH: / | ||
PAGES_PROJECT: kb-adg | ||
|
||
on: | ||
push: | ||
branches: | ||
|
@@ -28,12 +34,42 @@ jobs: | |
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Determine branch for deploy | ||
id: get-branch | ||
run: | | ||
if [ "${{ github.ref_name }}" == "master" ]; then | ||
echo "BRANCH_NAME=main" >> $GITHUB_ENV | ||
elif [ "${{ github.event_name }}" == "pull_request" ]; then | ||
PR_NUMBER=${{ github.event.number }} | ||
echo "BRANCH_NAME=pull-request-${PR_NUMBER}" >> $GITHUB_ENV | ||
else | ||
echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV | ||
fi | ||
- name: Run build | ||
run: pnpm build | ||
run: | | ||
URL=https://${{ env.BASE_DOMAIN }} BASE_URL=${{ env.BASE_PATH }} pnpm build | ||
# Disable crawlers for preview builds. | ||
echo "User-Agent: *\nDisallow: /" > build/robots.txt | ||
- name: Install Wrangler | ||
run: npm install -g wrangler | ||
|
||
- name: Deploy to Cloudflare Pages | ||
run: npx wrangler pages deploy ./build --project-name="${{ env.PAGES_PROJECT }}" --branch ${{ env.BRANCH_NAME }} | ||
env: | ||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_WORKERS_API_TOKEN }} | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_WORKERS_ACCOUNT_ID }} | ||
|
||
- name: Deploy | ||
if: github.ref == 'refs/heads/master' | ||
uses: JamesIves/github-[email protected] | ||
- name: Add comment to Pull Request | ||
if: github.event_name == 'pull_request' | ||
uses: actions/github-script@v6 | ||
with: | ||
branch: gh-pages | ||
folder: build | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: `Preview was deployed to: https://${{ env.BRANCH_NAME }}.${{ env.BASE_DOMAIN }}${{ env.BASE_PATH }}` | ||
}) |
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,5 +1,8 @@ | ||
name: Lint Markdown | ||
|
||
env: | ||
NODE_VERSION: 20 | ||
|
||
on: | ||
push: | ||
branches: | ||
|
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
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
Oops, something went wrong.