Skip to content

Commit

Permalink
Deploy from samuel-ping.github.io; hopefully fix css fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-ping committed Dec 30, 2023
1 parent ec2d054 commit f97b409
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
26 changes: 9 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Builds and pushes frontend to gh-pages branch
# Pushes backend to server branch

name: deploy next.js site to gh pages

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
Expand All @@ -27,12 +22,10 @@ concurrency:
cancel-in-progress: false

jobs:
# pushes frontend code to gh-pages branch
build:
runs-on: ubuntu-latest

steps:
# Checks out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v4

Expand All @@ -52,12 +45,6 @@ jobs:

- name: Setup Pages
uses: actions/configure-pages@v4
with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: next

- name: Restore cache
uses: actions/cache@v3
Expand All @@ -76,16 +63,21 @@ jobs:
- name: Build with Next.js
run: npx next build

- name: Static HTML export with Next.js
run: npx next export

- name: Add CNAME and a README to artifact
run: |
echo "samuelp.ing" > out/CNAME
echo "# Hi!" > out/README.md
echo "You're currently looking at the build artifacts of my website. To check out the code, switch over to the [Main branch](https://github.com/samuel-ping/personal-website-v3)!" >> out/README.md
echo "You're currently looking at the build artifacts of my website. To check out the code, switch over to the [Main branch](https://github.com/samuel-ping/personal-website)!" >> out/README.md
echo "#### Note - This message was automatically generated." >> out/README.md
- name: Push to samuel-ping.github.io
uses: s0/git-publish-subdir-action@develop
env:
REPO: git@github.com:samuel-ping/samuel-ping.github.io.git
BRANCH: gh-pages
FOLDER: ./out
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_PRIVATE_KEY }}

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
5 changes: 2 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**
* @type {import('next').NextConfig}
*/
const isProd = process.env.NODE_ENV === 'production';

const nextConfig = {
images: { unoptimized: true },
output: 'export',
Expand Down

0 comments on commit f97b409

Please sign in to comment.