forked from apache/apisix-website
-
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.
feat(CI): add a GitHub Action to lint the YAML (apache#111)
- add a `.yamllint` config file - lint some YAML
- Loading branch information
Showing
4 changed files
with
50 additions
and
35 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,2 +1,2 @@ | ||
publish: | ||
whoami: asf-site | ||
whoami: asf-site |
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 |
---|---|---|
|
@@ -6,10 +6,10 @@ name: CI | |
# events but only for the master branch | ||
on: | ||
push: | ||
branches: [ master ] | ||
branches: [master] | ||
schedule: | ||
# Run everyday at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07) | ||
- cron: "0 9 * * *" | ||
# Run everyday at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07) | ||
- cron: "0 9 * * *" | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
|
@@ -20,34 +20,34 @@ jobs: | |
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Clone apisix's docs from repo & update image's link | ||
run: | | ||
git clone https://github.com/apache/apisix.git | ||
cp -r apisix/doc/images ./website/static && rm -rf apisix/doc/images | ||
cp -r apisix/doc ./docs/apisix | ||
- name: Build | ||
run: cd website && yarn && yarn build | ||
|
||
- name: Copy files | ||
run: | | ||
cd website/build/apisix-website | ||
cp ../../../README.md ./ && cp ../../../.asf.yaml ./ | ||
cd apisix | ||
find . -type f -name "*.html" -print0 | xargs -0 sed -i -e 's/src="\.\.\/\.\.\/doc\/images/src="https:\/\/apisix\.apache\.org\/images/g' | ||
find . -type f -name "*.html" -print0 | xargs -0 sed -i -e 's/src="\.\.\/\.\.\/images/src="https:\/\/apisix\.apache\.org\/images/g' | ||
find . -type f -name "*.html" -print0 | xargs -0 sed -i -e 's/src="\.\.\/images/src="https:\/\/apisix\.apache\.org\/images/g' | ||
find . -type f -name "*.html" -print0 | xargs -0 sed -i -e 's/src="\.\/images/src="https:\/\/apisix\.apache\.org\/images/g' | ||
find . -type f -name "*.html" -print0 | xargs -0 sed -i -e 's/src="images/src="https:\/\/apisix\.apache\.org\/images/g' | ||
- name: GitHub Pages | ||
uses: crazy-max/[email protected] | ||
with: | ||
build_dir: website/build/apisix-website | ||
target_branch: asf-site | ||
keep_history: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Clone apisix's docs from repo & update image's link | ||
run: | | ||
git clone https://github.com/apache/apisix.git | ||
cp -r apisix/doc/images ./website/static && rm -rf apisix/doc/images | ||
cp -r apisix/doc ./docs/apisix | ||
- name: Build | ||
run: cd website && yarn && yarn build | ||
|
||
- name: Copy files | ||
run: | | ||
cd website/build/apisix-website | ||
cp ../../../README.md ./ && cp ../../../.asf.yaml ./ | ||
cd apisix | ||
find . -type f -name "*.html" -print0 | xargs -0 sed -i -e 's/src="\.\.\/\.\.\/doc\/images/src="https:\/\/apisix\.apache\.org\/images/g' | ||
find . -type f -name "*.html" -print0 | xargs -0 sed -i -e 's/src="\.\.\/\.\.\/images/src="https:\/\/apisix\.apache\.org\/images/g' | ||
find . -type f -name "*.html" -print0 | xargs -0 sed -i -e 's/src="\.\.\/images/src="https:\/\/apisix\.apache\.org\/images/g' | ||
find . -type f -name "*.html" -print0 | xargs -0 sed -i -e 's/src="\.\/images/src="https:\/\/apisix\.apache\.org\/images/g' | ||
find . -type f -name "*.html" -print0 | xargs -0 sed -i -e 's/src="images/src="https:\/\/apisix\.apache\.org\/images/g' | ||
- name: GitHub Pages | ||
uses: crazy-max/[email protected] | ||
with: | ||
build_dir: website/build/apisix-website | ||
target_branch: asf-site | ||
keep_history: true | ||
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 |
---|---|---|
|
@@ -14,3 +14,10 @@ jobs: | |
node-version: '12.x' | ||
- run: npm install -g [email protected] | ||
- run: markdownlint '**/*.md' --ignore node_modules | ||
yamllint: | ||
name: 🍏 YAML | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: 🧹 YAML Lint | ||
uses: ibiqlik/action-yamllint@v3 |
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,8 @@ | ||
--- | ||
|
||
extends: default | ||
|
||
rules: | ||
document-start: false | ||
line-length: false | ||
truthy: false |