From dded36499c771851b1d9b7b8a795a7a536ab07bd Mon Sep 17 00:00:00 2001 From: priyanka9634 <102957031+priyanka9634@users.noreply.github.com> Date: Mon, 7 Aug 2023 16:00:43 +0530 Subject: [PATCH] fixes --- .github/workflows/deploy.yml | 71 ++++++++---------------------------- 1 file changed, 15 insertions(+), 56 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 06fd289..ee71ee3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 fpm - id: install_fpm - continue-on-error: false - run: sh -c "$(curl -fsSL https://raw.githubusercontent.com/FifthTry/fpm/main/install-fpm.sh)" - - name: Build the pages with fpm - id: build - continue-on-error: false + - run: sh -c "$(curl -fsSL https://fastn.io/install.sh)" + - name: Build the pages with fastn run: | echo "Using '$CI_REPOSITORY_NAME_SLUG/' as the base while building" - fpm build --base=/$CI_REPOSITORY_NAME/ - - uses: actions/upload-artifact@master + # 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=/ + - 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 "actions-user@users.noreply.github.com" - 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