You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This script will build static site files and push them to a `gh-pages` branch of your repository.# If you are able to go into the `gh-pages` branch and see you static content then the build action# was successful in GitHub and you can continue on with configuring your repository to publish the # content of the `gh-pages` branch to your default repository website (which should look like # https://[gitUsername].github.io/[repositoryName]/). To publish this website, # in your GitHub repository online, go to Settings/Pages/Build and deployment/Source and choose the# `Deploy from branch`. Then just below that option choose `gh-pages` as the branch. name: Build static files to gh-pageson:
# Runs on pushes targeting the default branchpush:
branches: ["main"]# Allows you to run this workflow manually from the Actions tabworkflow_dispatch:
# Allow one concurrent deploymentconcurrency:
group: "pages"cancel-in-progress: truejobs:
build:
runs-on: ubuntu-lateststeps:
- name: Clone repositoryuses: actions/checkout@v3
- name: Setup Deno environmentuses: denoland/setup-deno@v1with:
deno-version: v1.x
- name: Build siterun: | deno task build --location=https://lumeland.github.io/base-blog/
- name: Push static files to gh-pages branchuses: crazy-max/ghaction-github-pages@v3with:
target_branch: gh-pagesbuild_dir: _siteenv:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
I'm guessing the addition of ...
with:
target_branch: gh-pages
...helped create the gh-pages branch and maybe using ghaction-github-pages@v3 helped too, but I didn't do much testing between the current version and this version to see what made the difference. If would like for me to send a PR for this I will.
For what it is worth GitHub Pages does a better job at caching resources out of the box. If using Vercel, I would suggest running this build script on GitHub and instead of telling Vercel to build the site on Vercel. If this script is successful in creating a gh-pages branch in your repository, go to the Git settings within your Vercel project and use the gh-pages branch from GitHub (which would have all of the static site files prebuilt for Vercel). You will also need to include a vercel.json (at least at the time of this writing) to set any caching headers, because Vercel will not cache HTTP resources by default when users make requests to the site. Just my 2cents.
The text was updated successfully, but these errors were encountered:
I don't see any significant differency between your configuration and the existing one in this repo. The gh-pages branch name is the default, so I think it's not required. Maybe the upgrade to ghaction-github-pages@v3 would be a nice change.
I was not able to get the GitHub website build script https://github.com/lumeland/base-blog/blob/master/.github/workflows/build.yml to push the static files to a
gh-pages
branch. I had to modify it slightly to the following:I'm guessing the addition of ...
...helped create the
gh-pages
branch and maybe usingghaction-github-pages@v3
helped too, but I didn't do much testing between the current version and this version to see what made the difference. If would like for me to send a PR for this I will.For what it is worth GitHub Pages does a better job at caching resources out of the box. If using Vercel, I would suggest running this build script on GitHub and instead of telling Vercel to build the site on Vercel. If this script is successful in creating a
gh-pages
branch in your repository, go to the Git settings within your Vercel project and use thegh-pages
branch from GitHub (which would have all of the static site files prebuilt for Vercel). You will also need to include a vercel.json (at least at the time of this writing) to set any caching headers, because Vercel will not cache HTTP resources by default when users make requests to the site. Just my 2cents.The text was updated successfully, but these errors were encountered: