blog/.forgejo/workflows/depoly.yml

65 lines
1.8 KiB
YAML
Raw Normal View History

2024-03-09 07:23:59 +00:00
name: Build & Depoly
on: [push]
jobs:
depoly:
runs-on: docker
container:
image: node:20-bullseye
2024-03-09 07:23:59 +00:00
name: Depoly blog
steps:
2024-06-07 02:22:44 +00:00
- name: Install git-lfs
run: apt update -y && apt install -y git-lfs
2024-03-09 07:23:59 +00:00
- name: Checkout
uses: actions/checkout@v4
2024-03-09 07:23:59 +00:00
with:
submodules: true # Checkout private submodules(themes or something else).
2024-06-07 05:42:11 +00:00
- name: Checkout LFS
run: |
2024-06-07 05:39:27 +00:00
UrlBase=$GITHUB_SERVER_URL; \
UrlLfsBase=$UrlBase/${{ github.repository }}.git/info/lfs/objects; \
Auth=`/usr/bin/git config --get --local http.$UrlBase/.extraheader`; \
/usr/bin/git config --local http.${UrlLfsBase}/batch.extraheader "$Auth"; \
/usr/bin/git config --local http.${UrlLfsBase}/.extraheader ''
git config --local lfs.transfer.maxretries 1
git lfs fetch origin refs/remotes/origin/${{ github.ref_name }}
git lfs checkout
2024-03-09 07:23:59 +00:00
- name: Setup pnpm
run: |
corepack enable
2024-06-03 16:16:08 +00:00
corepack prepare pnpm@latest-9 --activate
2024-03-09 07:23:59 +00:00
pnpm config set store-dir /tmp/pnpm-store
- name: Cache Dependencies
id: dependencies-cache
uses: actions/cache@v4
with:
path: /tmp/pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install Dependencies
run: pnpm install
- name: Cache Generated Files
id: files-cache
uses: actions/cache@v4
with:
path: |
public/**
2024-06-02 08:52:06 +00:00
db.json
2024-06-07 05:52:10 +00:00
key: generated-files-1
2024-03-09 07:23:59 +00:00
- name: Build Website
run: pnpm build
- name: Depoly Website
uses: https://github.com/cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
2024-06-02 08:04:26 +00:00
command: pages deploy --project-name=rubicons-blog public