Skip to content

Merge pull request #1075 from vorth/link-previews #23

Merge pull request #1075 from vorth/link-previews

Merge pull request #1075 from vorth/link-previews #23

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# building and deploying an 11ty site to Dreamhost
name: vZome website
on:
# Runs on pushes targeting the default branch, changing "website"
push:
# TODO: change to main when ready
branches: ["main"]
paths:
- 'website/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# 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.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
if: github.repository == 'vZome/vzome'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: 'true'
- name: Checkout nested repo
uses: actions/checkout@v4
with:
repository: vorth/vzome-sharing
path: website/vzome-sharing
ref: 11ty-build
token: ${{ secrets.GITHUB_TOKEN }} # Use PAT if private repo
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22' # or whatever version you're using
- name: Enable Corepack
run: corepack enable
- name: Build with 11ty
# Outputs to the './_site' directory by default
run: |
cd website
yarn install
IMAGES_URL=https://pub-72dcd7653cf3451d9ef0ad02dda76a89.r2.dev yarn exec eleventy
find _site
- name: Configure SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/dreamhost.key
chmod 600 ~/.ssh/dreamhost.key
cat >>~/.ssh/config <<END
Host dreamhost
HostName $HOSTING_FQDN
User scottvorthmann
IdentityFile ~/.ssh/dreamhost.key
StrictHostKeyChecking no
END
cat ~/.ssh/config
env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
HOSTING_FQDN: ${{ secrets.HOSTING_FQDN }}
- name: Publish website to DreamHost
run: |
sftp -b - dreamhost <<END
cd vzome.com
put -r ./website/_site/* .
END