Skip to content

Add Energy Management guide #108

Add Energy Management guide

Add Energy Management guide #108

Workflow file for this run

name: Deploy PR previews
on:
# Only run on Staging
pull_request_target:
types:
- opened
- reopened
- synchronize
concurrency: preview-${{ github.ref }}
permissions:
contents: write
pull-requests: write
defaults:
run:
shell: bash
jobs:
build-preview:
if: github.repository == 'project-chip/matter-handbook'
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.115.4
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "/pr-${{ github.event.number }}"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./public
- name: Deploy preview
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: './public'
DEST_DIR: 'pr-${{ github.event.number }}'
- name: Invalidate CloudFront
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.AWS_CF_DISTRIBUTION }}
PATHS: '/pr-${{ github.event.number }}/*'
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Preview deployed at ${{ vars.PREVIEW_URL }}/pr-${{ github.event.number }}