This commit is contained in:
parent
38783f27c2
commit
17406aad2a
4 changed files with 28 additions and 116 deletions
|
@ -1,41 +0,0 @@
|
||||||
steps:
|
|
||||||
build:
|
|
||||||
image: golang:1.21-bookworm
|
|
||||||
environment:
|
|
||||||
- HUGO_VERSION=0.123.4
|
|
||||||
- TZ=Europe/Berlin
|
|
||||||
when:
|
|
||||||
- event: push
|
|
||||||
branch: [main, staging]
|
|
||||||
commands:
|
|
||||||
- wget https://github.com/gohugoio/hugo/releases/download/v$${HUGO_VERSION}/hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && apt install ./hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && rm -f hugo_extended_$${HUGO_VERSION}_linux-amd64.deb
|
|
||||||
- hugo --minify --destination ./public
|
|
||||||
|
|
||||||
deploy-cloudflare-production:
|
|
||||||
image: node:alpine
|
|
||||||
# image: lauralani/netlify-cli:latest
|
|
||||||
pull: true
|
|
||||||
when:
|
|
||||||
- event: push
|
|
||||||
branch: main
|
|
||||||
secrets:
|
|
||||||
- CLOUDFLARE_ACCOUNT_ID
|
|
||||||
- CLOUDFLARE_API_TOKEN
|
|
||||||
commands:
|
|
||||||
- npm install wrangler --save-dev
|
|
||||||
- npx wrangler pages deploy ./public --project-name adorable-website
|
|
||||||
|
|
||||||
|
|
||||||
#deploy-production:
|
|
||||||
# # image: node:alpine
|
|
||||||
# image: lauralani/netlify-cli:latest
|
|
||||||
# pull: true
|
|
||||||
# when:
|
|
||||||
# - event: push
|
|
||||||
# branch: main
|
|
||||||
# secrets:
|
|
||||||
# - NETLIFY_AUTH_TOKEN
|
|
||||||
# - NETLIFY_SITE_ID
|
|
||||||
# commands:
|
|
||||||
# # - npm install netlify-cli -g
|
|
||||||
# - netlify deploy --prod --dir ./public
|
|
|
@ -1,41 +0,0 @@
|
||||||
steps:
|
|
||||||
build:
|
|
||||||
image: golang:1.21-bookworm
|
|
||||||
environment:
|
|
||||||
- HUGO_VERSION=0.123.4
|
|
||||||
- TZ=Europe/Berlin
|
|
||||||
when:
|
|
||||||
- event: push
|
|
||||||
branch: [main, staging]
|
|
||||||
commands:
|
|
||||||
- wget https://github.com/gohugoio/hugo/releases/download/v$${HUGO_VERSION}/hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && apt install ./hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && rm -f hugo_extended_$${HUGO_VERSION}_linux-amd64.deb
|
|
||||||
- hugo --minify --destination ./public
|
|
||||||
|
|
||||||
deploy-staging:
|
|
||||||
# image: node:alpine
|
|
||||||
image: lauralani/netlify-cli:latest
|
|
||||||
pull: true
|
|
||||||
when:
|
|
||||||
- event: push
|
|
||||||
branch: staging
|
|
||||||
secrets:
|
|
||||||
- NETLIFY_AUTH_TOKEN
|
|
||||||
- NETLIFY_SITE_ID
|
|
||||||
commands:
|
|
||||||
# - npm install netlify-cli -g
|
|
||||||
- netlify deploy --alias stage --dir ./public
|
|
||||||
|
|
||||||
|
|
||||||
deploy-production:
|
|
||||||
# image: node:alpine
|
|
||||||
image: lauralani/netlify-cli:latest
|
|
||||||
pull: true
|
|
||||||
when:
|
|
||||||
- event: push
|
|
||||||
branch: main
|
|
||||||
secrets:
|
|
||||||
- NETLIFY_AUTH_TOKEN
|
|
||||||
- NETLIFY_SITE_ID
|
|
||||||
commands:
|
|
||||||
# - npm install netlify-cli -g
|
|
||||||
- netlify deploy --prod --dir ./public
|
|
|
@ -1,8 +1,8 @@
|
||||||
steps:
|
steps:
|
||||||
build:
|
build:
|
||||||
image: golang:1.21-bookworm
|
image: golang:1.22-bookworm
|
||||||
environment:
|
environment:
|
||||||
- HUGO_VERSION=0.123.4
|
- HUGO_VERSION=0.128.2
|
||||||
- TZ=Europe/Berlin
|
- TZ=Europe/Berlin
|
||||||
when:
|
when:
|
||||||
- event: push
|
- event: push
|
||||||
|
@ -11,37 +11,42 @@ steps:
|
||||||
- wget https://github.com/gohugoio/hugo/releases/download/v$${HUGO_VERSION}/hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && apt install ./hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && rm -f hugo_extended_$${HUGO_VERSION}_linux-amd64.deb
|
- wget https://github.com/gohugoio/hugo/releases/download/v$${HUGO_VERSION}/hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && apt install ./hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && rm -f hugo_extended_$${HUGO_VERSION}_linux-amd64.deb
|
||||||
- hugo --minify --destination ./public
|
- hugo --minify --destination ./public
|
||||||
|
|
||||||
upload:
|
upload-prod:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
|
when:
|
||||||
|
- branch: main
|
||||||
secrets:
|
secrets:
|
||||||
- RSYNC_SSHKEY
|
- RSYNC_SSHKEY
|
||||||
- RSYNC_TARGET_SERVER
|
- RSYNC_TARGET_SERVER
|
||||||
- RSYNC_TARGET_USER
|
- RSYNC_TARGET_USER
|
||||||
environment:
|
environment:
|
||||||
- TARGET_PATH=/webroot/adora.codes
|
- TARGET_PATH=/webroot/adora.codes
|
||||||
when:
|
- RSYNC_TARGET_PORT=2003
|
||||||
- event: push
|
|
||||||
branch: main
|
|
||||||
commands:
|
commands:
|
||||||
|
- cd docs/
|
||||||
- apk add --update --no-cache openssh rsync git
|
- apk add --update --no-cache openssh rsync git
|
||||||
- mkdir -p $HOME/.ssh
|
- mkdir -p $HOME/.ssh
|
||||||
- echo "$RSYNC_SSHKEY" > $HOME/.ssh/id_ed25519
|
- echo "$RSYNC_SSHKEY" > $HOME/.ssh/id_ed25519
|
||||||
- chmod 0600 $HOME/.ssh/id_ed25519
|
- chmod 0600 $HOME/.ssh/id_ed25519
|
||||||
- ssh-keyscan -t ed25519 $RSYNC_TARGET_SERVER >> $HOME/.ssh/known_hosts
|
- ssh-keyscan -t ed25519 -p $RSYNC_TARGET_PORT $RSYNC_TARGET_SERVER >> $HOME/.ssh/known_hosts
|
||||||
- rsync -avh --delete ./public/ $RSYNC_TARGET_USER@$RSYNC_TARGET_SERVER:$TARGET_PATH
|
- rsync -avh -e "ssh -p $RSYNC_TARGET_PORT" --delete ./public/ $RSYNC_TARGET_USER@$RSYNC_TARGET_SERVER:$TARGET_PATH
|
||||||
|
|
||||||
|
upload-staging:
|
||||||
|
image: alpine:latest
|
||||||
#deploy-production:
|
when:
|
||||||
# # image: node:alpine
|
- branch: staging
|
||||||
# image: lauralani/netlify-cli:latest
|
secrets:
|
||||||
# pull: true
|
- RSYNC_SSHKEY
|
||||||
# when:
|
- RSYNC_TARGET_SERVER
|
||||||
# - event: push
|
- RSYNC_TARGET_USER
|
||||||
# branch: main
|
environment:
|
||||||
# secrets:
|
- TARGET_PATH=/webroot/www-staging.adora.codes
|
||||||
# - NETLIFY_AUTH_TOKEN
|
- RSYNC_TARGET_PORT=2003
|
||||||
# - NETLIFY_SITE_ID
|
commands:
|
||||||
# commands:
|
- cd docs/
|
||||||
# # - npm install netlify-cli -g
|
- apk add --update --no-cache openssh rsync git
|
||||||
# - netlify deploy --prod --dir ./public
|
- mkdir -p $HOME/.ssh
|
||||||
|
- echo "$RSYNC_SSHKEY" > $HOME/.ssh/id_ed25519
|
||||||
|
- chmod 0600 $HOME/.ssh/id_ed25519
|
||||||
|
- ssh-keyscan -t ed25519 -p $RSYNC_TARGET_PORT $RSYNC_TARGET_SERVER >> $HOME/.ssh/known_hosts
|
||||||
|
- rsync -avh -e "ssh -p $RSYNC_TARGET_PORT" --delete ./public/ $RSYNC_TARGET_USER@$RSYNC_TARGET_SERVER:$TARGET_PATH
|
||||||
|
|
11
netlify.toml
11
netlify.toml
|
@ -1,11 +0,0 @@
|
||||||
# Redirect netlify alias
|
|
||||||
|
|
||||||
[[redirects]]
|
|
||||||
from = "https://personal-website-40cb76.netlify.app/"
|
|
||||||
to = "https://adora.codes/"
|
|
||||||
status = 301
|
|
||||||
|
|
||||||
[[redirects]]
|
|
||||||
from = "https://personal-website-40cb76.netlify.app/*"
|
|
||||||
to = "https://adora.codes/"
|
|
||||||
status = 301
|
|
Loading…
Reference in a new issue