Merge pull request #1 from NeilHanlon/migrate-to-github-pages

migrate deploy to github pages with cnames
This commit is contained in:
Neil Hanlon
2025-08-08 14:11:56 -04:00
committed by GitHub
4 changed files with 13 additions and 40 deletions
+12 -1
View File
@@ -18,6 +18,8 @@ permissions:
contents: read contents: read
pages: write pages: write
id-token: write id-token: write
issues: write
pull-requests: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
@@ -36,7 +38,7 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
HUGO_VERSION: 0.148.0 HUGO_VERSION: 0.148.2
HUGO_ENVIRONMENT: production HUGO_ENVIRONMENT: production
TZ: America/New_York TZ: America/New_York
steps: steps:
@@ -72,6 +74,14 @@ jobs:
--minify \ --minify \
--baseURL "${{ steps.pages.outputs.base_url }}/" \ --baseURL "${{ steps.pages.outputs.base_url }}/" \
--cacheDir "${{ runner.temp }}/hugo_cache" --cacheDir "${{ runner.temp }}/hugo_cache"
- name: Create CNAME file
run: |
cat << EOF > public/CNAME
neilhanlon.me
neilhanlon.com
hanlon.ninja
thepotato.tech
EOF
- name: Cache Save - name: Cache Save
id: cache-save id: cache-save
uses: actions/cache/save@v4 uses: actions/cache/save@v4
@@ -122,6 +132,7 @@ jobs:
- name: Comment PR - name: Comment PR
uses: actions/github-script@v7 uses: actions/github-script@v7
with: with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: | script: |
const domain = `thepotato-tech-pr-${{ github.event.number }}.surge.sh`; const domain = `thepotato-tech-pr-${{ github.event.number }}.surge.sh`;
github.rest.issues.createComment({ github.rest.issues.createComment({
-1
View File
@@ -1,4 +1,3 @@
//$primary-color: #ABC9E3;
$primary-color: #115c9e; $primary-color: #115c9e;
$hover-color: #5E7191; $hover-color: #5E7191;
-37
View File
@@ -1,37 +0,0 @@
#!/bin/bash -ex
export GIT_AUTHOR_NAME="${GIT_AUTHOR_NAME}"
export GIT_AUTHOR_EMAIL="${GIT_AUTHOR_EMAIL}"
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
REMOTE="${PUSH_REMOTE:-git@git.shrug.pw:neil/neilhanlon.me.git}"
rm -fr pages.git
mkdir pages.git
( cd pages.git && git init -b pages )
rsync -av public/* pages.git
cat << EOF > pages.git/.domains
neilhanlon.me
neilhanlon.com
hanlon.ninja
thepotato.tech
EOF
cp .woodpecker.yml pages.git/
cd pages.git
set -x
git config user.name "$GIT_AUTHOR_NAME"
git config user.email "$GIT_AUTHOR_EMAIL"
git add -A
git commit -m "Deployment at $(date -u -Is)"
git remote add origin $REMOTE
git push -f origin pages
curl -X POST --fail \
-F token=$GITLAB_DEPLOY_TOKEN \
-F ref=main \
https://gitlab.com/api/v4/projects/29559707/trigger/pipeline