Skip to content

Commit

Permalink
Update deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
harshdoesdev committed Jan 15, 2024
1 parent 9fd49cc commit 0a966c8
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions .github/workflows/deploy.yml
Expand Up @@ -2,37 +2,40 @@ name: Deploy Site

on:
push:
branches: [ main ]
paths:
- '**.ftd'
- '**.md'
branches:
- main
workflow_dispatch:
workflow_call:
env:
CARGO_TERM_COLOR: always

jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout code
uses: actions/checkout@v2
- name: Pull the latest commits
run: git pull
- 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/fastn-stack/fastn/main/install.sh)"
- run: sh -c "$(curl -fsSL https://fastn.com/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/
- name: copy CNAME
# To deploy the website using GitHub Pages, use the below command
fastn build --edition=2023 --base=/$CI_REPOSITORY_NAME/ --zip-url=${{ steps.get_zip_url.outputs.zip_url }}
# To deploy the website using Custom Domain, use the below command and comment
#out the above command when deploying through GitHub Pages
#fastn build --edition=2023 --base=/ --zip-url=${{ steps.get_zip_url.outputs.zip_url }}
- name: copy CNAME if found
run: '(test -f CNAME && cp CNAME .build) || echo "CNAME does not exist, skipping step"'
- name: Deploy
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./.build

0 comments on commit 0a966c8

Please sign in to comment.