generated from fastn-stack/fastn-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added deploy.yml file: github workflow
- Loading branch information
1 parent
46e7d01
commit cdb870b
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Deploy Site | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
permissions: write-all | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Pull the latest commits | ||
run: git pull | ||
- uses: FranzDiebold/github-env-vars-action@v2 | ||
- run: sh -c "$(curl -fsSL https://fastn.com/install.sh)" | ||
- name: Build the pages with fastn | ||
run: | | ||
echo "Using '$CI_REPOSITORY_NAME_SLUG/' as the base while building" | ||
# To deploy the website using GitHub Pages, use the below command | ||
# fastn build --base=/$CI_REPOSITORY_NAME/ | ||
# To deploy the website using Custom Domain, use the below command and comment | ||
# out the above command when deploying through GitHub Pages | ||
# fastn build --base=/ | ||
fastn build --base=/ --zip-url=https://codeload.github.com/fifthtry/ui/zip/refs/heads/main | ||
- name: copy CNAME if found | ||
run: '(test -f CNAME && cp CNAME .build) || echo "CNAME does not exist, skipping step"' | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./.build |