You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by me...@apache.org on 2020/12/17 13:57:32 UTC

[apisix-website] branch master updated: feat(CI): add a GitHub Action to lint the YAML (#111)

This is an automated email from the ASF dual-hosted git repository.

membphis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git


The following commit(s) were added to refs/heads/master by this push:
     new c80b6bc  feat(CI): add a GitHub Action to lint the YAML (#111)
c80b6bc is described below

commit c80b6bcb652c5c71660f77dbc3a2f32a15c2299f
Author: John Bampton <jb...@users.noreply.github.com>
AuthorDate: Thu Dec 17 23:57:25 2020 +1000

    feat(CI): add a GitHub Action to lint the YAML (#111)
    
    - add a `.yamllint` config file
    - lint some YAML
---
 .asf.yaml                    |  2 +-
 .github/workflows/deploy.yml | 68 ++++++++++++++++++++++----------------------
 .github/workflows/lint.yml   |  7 +++++
 .yamllint                    |  8 ++++++
 4 files changed, 50 insertions(+), 35 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index 0ba12c6..0735550 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -1,2 +1,2 @@
 publish:
-  whoami:  asf-site
\ No newline at end of file
+  whoami: asf-site
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index cac155a..b87951e 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -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/ghaction-github-pages@v2.0.1
-      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/ghaction-github-pages@v2.0.1
+        with:
+          build_dir: website/build/apisix-website
+          target_branch: asf-site
+          keep_history: true
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 3a283bb..618187f 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -14,3 +14,10 @@ jobs:
           node-version: '12.x'
       - run: npm install -g markdownlint-cli@0.25.0
       - 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
diff --git a/.yamllint b/.yamllint
new file mode 100644
index 0000000..8a9f034
--- /dev/null
+++ b/.yamllint
@@ -0,0 +1,8 @@
+---
+
+extends: default
+
+rules:
+  document-start: false
+  line-length: false
+  truthy: false