This repository has been archived by the owner on Nov 12, 2024. It is now read-only.
design-system-part-2-blog #36
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: Deploy Site | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '**.ftd' | |
- '**.md' | |
workflow_dispatch: | |
workflow_call: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: FranzDiebold/github-env-vars-action@v2 | |
- name: Install fastn | |
id: install_fastn | |
continue-on-error: false | |
run: sh -c "$(curl -fsSL https://raw.githubusercontent.com/ftd-lang/fastn/main/install.sh)" | |
- name: Get latest commit information | |
id: get_commit | |
run: echo "::set-output name=commit_sha::$(git rev-parse HEAD)" | |
- name: Get raw zipball URL | |
id: get_zip_url | |
run: | | |
echo "::set-output name=zip_url::https://github.com/${{ github.repository }}/archive/${{ steps.get_commit.outputs.commit_sha }}.zip" | |
- name: Build the pages with fastn | |
id: build | |
continue-on-error: false | |
run: | | |
echo "Using '$CI_REPOSITORY_NAME_SLUG/' as the base while building" | |
fastn build --base=/$CI_REPOSITORY_NAME/ --zip-url=${{ steps.get_zip_url.outputs.zip_url }} | |
- name: copy CNAME | |
run: '(test -f CNAME && cp CNAME .build) || echo "CNAME does not exist, skipping step"' | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./.build |