website/.github/workflows/default.yaml
Max Richter 5e931f15d3
Some checks failed
Deploy to GitHub Pages / build (push) Failing after 10m44s
Deploy to GitHub Pages / deploy (push) Has been skipped
feat: some shit
2024-04-03 17:46:04 +02:00

80 lines
2.2 KiB
YAML

name: Deploy to GitHub Pages
on:
push:
branches: [ main ]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: 📦 Install git-lfs
run: apt update && apt install git-lfs zstd
- name: 🔢 Calculate cache ids
run: |
git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
LFS_CACHE_ID=$(cat .lfs-assets-id | md5sum)-v1 # Get the GitHub repository name
PNPM_CACHE_ID=$( cat pnpm-lock.yaml | md5sum )-v1
echo "LFS_CACHE_ID=$LFS_CACHE_ID" >> $GITHUB_ENV
echo "PNPM_STORE_PATH=$(pnpm store path)" >> $GITHUB_ENV
echo "PNPM_CACHE_ID=$PNPM_CACHE_ID" >> $GITHUB_ENV
- name: LFS Cache
uses: actions/cache@v3
with:
path: .git/lfs/objects
key: ${{ runner.os }}-lfs-${{ env.LFS_CACHE_ID }}
restore-keys: |
- name: 📦 Install PNPM
uses: pnpm/action-setup@v3
id: pnpm-install
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install, build, and upload your site output
run: pnpm i && pnpm build
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: 🚀 Deploy files via SFTP
uses: https://github.com/pressidium/lftp-mirror-action@v1
with:
host: ${{ secrets.FTP_HOST }}
port: ${{ secrets.FTP_PORT || 21 }}
user: ${{ secrets.FTP_USERNAME }}
pass: ${{ secrets.FTP_PASSWORD }}
onlyNewer: true
parallel: '4'
settings: 'sftp:auto-confirm=yes'
localDir: 'public'
remoteDir: '/share/new-website'
options: '--verbose'