Skip to content

Commit

Permalink
Merge pull request #13 from FifthTry/fixing-build-issue
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
priyanka9634 committed Aug 7, 2023
2 parents e6362f5 + f853429 commit 61dc6a8
Showing 1 changed file with 13 additions and 54 deletions.
67 changes: 13 additions & 54 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,28 @@ name: Deploy Site
on:
push:
branches: [ main ]
paths:
- '**.ftd'
- '**.md'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
workflow_call:

jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v2
- 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/FifthTry/fastn/main/install-fastn.sh)"
- run: sh -c "$(curl -fsSL https://fastn.io/install.sh)"
- name: Build the pages with fastn
id: build
continue-on-error: false
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/
- uses: actions/upload-artifact@master
# 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=/
- name: copy CNAME if found
run: '(test -f CNAME && cp CNAME .build) || echo "CNAME does not exist, skipping step"'
- uses: peaceiris/actions-gh-pages@v3
with:
name: GH_PAGES_BUILD
path: .build/
deploy-gh-pages:
runs-on: ubuntu-latest
needs: build
steps:
- name: Prepare `gh-pages` branch creation
id: clone_main
uses: actions/checkout@v2
- name: Check if `gh-pages` branch exists
id: branch_exists
continue-on-error: true
run: /usr/bin/git ls-remote --heads origin gh-pages | grep ""
- name: Create branch if not exists
id: create_branch
if: steps.branch_exists.outcome != 'success'
run: |
git config --global user.email "[email protected]"
git config --global user.name "actions-user"
git checkout --orphan gh-pages
git reset --hard
git commit --allow-empty -m "Initializing gh-pages branch"
git push origin gh-pages
- name: Checkout gh-pages branch
uses: actions/checkout@v2
if: steps.branch_exists.outcome == 'success'
with:
ref: gh-pages
- run: /bin/rm -rf *
- uses: actions/download-artifact@master
with:
name: GH_PAGES_BUILD
path: .
- uses: stefanzweifel/git-auto-commit-action@v4
name: Commit changes to build branch
with:
commit_message: SSR build
branch: gh-pages
commit_options: '--no-verify --signoff'
repository: .
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./.build

0 comments on commit 61dc6a8

Please sign in to comment.