Update website.yml #8
Workflow file for this run
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
name: Build and deploy website | |
on: [push] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build_demo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.16.0" | |
cache: true | |
# Manually Update this `key` | |
cache-key: "20230512" | |
- name: Build demo for web | |
run: | | |
cd packages/fleather/example | |
flutter build web --no-tree-shake-icons | |
- name: Archive the demo build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: demo_web_build | |
path: packages/fleather/example/build/web | |
build_website: | |
runs-on: ubuntu-latest | |
needs: build_demo | |
env: | |
HUGO_VERSION: 0.111.3 | |
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 Embedded | |
run: sudo snap install dart-sass-embedded | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
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: Download demo web build | |
uses: actions/download-artifact@v4 | |
with: | |
name: demo_web_build | |
path: docs/content/en/demo | |
- name: Build with Hugo | |
env: | |
# For maximum backward compatibility with Hugo modules | |
HUGO_ENVIRONMENT: production | |
HUGO_ENV: production | |
run: | | |
cd docs | |
hugo \ | |
--gc \ | |
--minify \ | |
--baseURL "${{ steps.pages.outputs.base_url }}/" | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: docs/public | |
deploy_website: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.base_url }} | |
runs-on: ubuntu-latest | |
needs: build_website | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v3 |