Move to Vercel
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
public/
|
public/
|
||||||
|
.vercel
|
||||||
|
@ -1,53 +1,32 @@
|
|||||||
# Exclude the pipeline to run on the pages branch
|
# Taken from https://www.markpitblado.me/blog/deploying-to-vercel-from-codeberg
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
exclude: pages
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Check for typos
|
preview:
|
||||||
typos:
|
image: node
|
||||||
image: alpine:edge
|
environment:
|
||||||
|
VERCEL_TOKEN:
|
||||||
|
from_secret: vercel_token
|
||||||
|
VERCEL_ORG_ID:
|
||||||
|
from_secret: vercel_org_id
|
||||||
|
VERCEL_PROJECT_ID:
|
||||||
|
from_secret: vercel_project_id
|
||||||
commands:
|
commands:
|
||||||
- apk add curl jq
|
- npm install --global vercel@latest
|
||||||
- curl -s "https://api.github.com/repos/crate-ci/typos/releases/latest" | jq -r '.assets[] | select(.name | contains("unknown-linux-musl")) | .browser_download_url' | xargs -n 1 curl -L -o typos.tar.gz
|
- vercel deploy --token=$VERCEL_TOKEN
|
||||||
- tar -zxvf typos.tar.gz ./typos
|
|
||||||
- ./typos
|
|
||||||
failure: ignore
|
|
||||||
when:
|
when:
|
||||||
event: [push, pull_request, manual]
|
event: [pull_request]
|
||||||
|
|
||||||
# Build Zola static files
|
deploy:
|
||||||
build:
|
image: node
|
||||||
image: alpine:edge
|
environment:
|
||||||
|
VERCEL_TOKEN:
|
||||||
|
from_secret: vercel_token
|
||||||
|
VERCEL_ORG_ID:
|
||||||
|
from_secret: vercel_org_id
|
||||||
|
VERCEL_PROJECT_ID:
|
||||||
|
from_secret: vercel_project_id
|
||||||
commands:
|
commands:
|
||||||
- apk add zola
|
- npm install --global vercel@latest
|
||||||
- zola build
|
- vercel deploy --prod --token=$VERCEL_TOKEN
|
||||||
when:
|
|
||||||
event: [push, pull_request, manual]
|
|
||||||
|
|
||||||
publish:
|
|
||||||
image: bitnami/git
|
|
||||||
# Must be set in Woodpecker configuration
|
|
||||||
# mail: Your email address used by Codeberg
|
|
||||||
# codeberg_token: Codeberg access token with "write:repository" permission
|
|
||||||
secrets: [mail, codeberg_token]
|
|
||||||
commands:
|
|
||||||
# Configure Git
|
|
||||||
- git config --global user.email $MAIL
|
|
||||||
- git config --global user.name "Woodpecker CI"
|
|
||||||
# Clone the output branch
|
|
||||||
- git clone --branch pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME
|
|
||||||
# Enter the output branch
|
|
||||||
- cd $CI_REPO_NAME
|
|
||||||
# Remove old files
|
|
||||||
- git rm -r "*" || true # Don't fail if there's nothing to remove
|
|
||||||
# Copy the output of the build step
|
|
||||||
- cp -ar ../public/. .
|
|
||||||
# Copy .domains in place (Duckquill specific. you should just place it in ./static/)
|
|
||||||
- cp ../.domains .
|
|
||||||
# Commit and push all static files with the source commit hash
|
|
||||||
- git add --all
|
|
||||||
- git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" --allow-empty
|
|
||||||
- git push
|
|
||||||
when:
|
when:
|
||||||
event: [push, manual]
|
event: [push, manual]
|
||||||
|
Reference in New Issue
Block a user