70 lines
1.7 KiB
YAML
70 lines
1.7 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 your repository using git
|
|
uses: actions/checkout@v4
|
|
|
|
- name: 📦 Install git-lfs
|
|
run: apt update && apt install git-lfs zstd
|
|
|
|
- name: 📦 Install PNPM
|
|
uses: https://github.com/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: 📥 Checkout lfs files
|
|
run: git lfs pull
|
|
|
|
- name: 📦 Install pnpm packages
|
|
run: pnpm install
|
|
|
|
- name: Install, build, and upload your site output
|
|
uses: withastro/action@v2
|
|
|
|
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'
|