Skip to content

Commit

Permalink
Build and editorconfig updates
Browse files Browse the repository at this point in the history
- Split docs build and trigger the code build only if non-docs changes are
pushed
- Update editor config for YAML files with 2 spaces for indent
  • Loading branch information
vijaykiran committed Apr 6, 2021
1 parent 2e9f417 commit 2e0a52f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 40 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ insert_final_newline = true
trim_trailing_whitespace = true
quote_type = double

[*.yml]
charset = utf-8
indent_style = space
indent_size = 2

[*.md]
max_line_length = off
trim_trailing_whitespace = false
46 changes: 46 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and publish Soda SQL Docs

on:
push:
paths:
- 'docs/**'

jobs:
publish-docs:
name: Deploy documentation
if: github.ref == 'refs/heads/main'
timeout-minutes: 10
runs-on: ubuntu-20.04
env:
AWS_CLOUDFRONT_ID: E2OAY23FHJNRE7
AWS_DOCS_BUCKET: soda-public-docs
AWS_DOCS_PATH: /soda-sql
steps:
- uses: actions/checkout@v2
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_DOCS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DOCS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_BUILD_DEFAULT_REGION }}
- name: Set up Ruby 2.7
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7
- uses: actions/cache@v2
with:
path: ./docs/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Build docs
working-directory: ./docs
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec jekyll build
- name: Publish docs
run: aws s3 sync --delete ./docs/_site s3://${AWS_DOCS_BUCKET}${AWS_DOCS_PATH}
- name: Invalidate cache
run: aws cloudfront create-invalidation --distribution-id ${AWS_CLOUDFRONT_ID} --paths "${AWS_DOCS_PATH}" "${AWS_DOCS_PATH}/*"
44 changes: 4 additions & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build soda-sql

on: [ push ]
on:
push:
paths-ignore:
- 'docs/**'

jobs:
run-tests:
Expand Down Expand Up @@ -131,42 +134,3 @@ jobs:
run: |
pip3 install -r requirements.txt
python3 report_release_success.py
publish-docs:
name: Deploy documentation
if: github.ref == 'refs/heads/main'
timeout-minutes: 10
runs-on: ubuntu-20.04
env:
AWS_CLOUDFRONT_ID: E2OAY23FHJNRE7
AWS_DOCS_BUCKET: soda-public-docs
AWS_DOCS_PATH: /soda-sql
steps:
- uses: actions/checkout@v2
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_DOCS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DOCS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_BUILD_DEFAULT_REGION }}
- name: Set up Ruby 2.7
uses: actions/setup-ruby@v1
with:
ruby-version: 2.7
- uses: actions/cache@v2
with:
path: ./docs/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Build docs
working-directory: ./docs
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec jekyll build
- name: Publish docs
run: aws s3 sync --delete ./docs/_site s3://${AWS_DOCS_BUCKET}${AWS_DOCS_PATH}
- name: Invalidate cache
run: aws cloudfront create-invalidation --distribution-id ${AWS_CLOUDFRONT_ID} --paths "${AWS_DOCS_PATH}" "${AWS_DOCS_PATH}/*"

0 comments on commit 2e0a52f

Please sign in to comment.