2024-09-12 19:37:37 +00:00
|
|
|
---
|
2024-09-12 08:48:17 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build
|
2024-09-12 19:37:37 +00:00
|
|
|
when:
|
|
|
|
event: [push]
|
|
|
|
image: node:20.17.0
|
2024-09-12 08:48:17 +00:00
|
|
|
commands:
|
2024-09-12 19:37:37 +00:00
|
|
|
- export GO_VERSION=1.22.3
|
|
|
|
- export HUGO_VERSION=0.134.2
|
|
|
|
- export HUGO_ENV=production
|
2024-09-12 08:48:17 +00:00
|
|
|
- apt-get update && apt-get install -y curl
|
2024-09-12 19:37:37 +00:00
|
|
|
- echo "https://github.com/gohugoio/hugo/releases/download/v$${HUGO_VERSION}/hugo_extended_$${HUGO_VERSION}_Linux-64bit.tar.gz"
|
|
|
|
- curl -LO "https://github.com/gohugoio/hugo/releases/download/v$${HUGO_VERSION}/hugo_extended_$${HUGO_VERSION}_Linux-64bit.tar.gz"
|
|
|
|
- tar -xvf hugo_extended_$${HUGO_VERSION}_Linux-64bit.tar.gz
|
2024-09-12 08:48:17 +00:00
|
|
|
- mv hugo /usr/local/bin/
|
2024-09-12 19:37:37 +00:00
|
|
|
- rm hugo_extended_$${HUGO_VERSION}_Linux-64bit.tar.gz
|
|
|
|
- echo "HUGO $${HUGO_VERSION} INSTALLED"
|
|
|
|
- curl -LO "https://dl.google.com/go/go$${GO_VERSION}.linux-amd64.tar.gz"
|
|
|
|
- tar -C /usr/local -xzf go$${GO_VERSION}.linux-amd64.tar.gz
|
2024-09-12 08:48:17 +00:00
|
|
|
- export PATH=$PATH:/usr/local/go/bin
|
2024-09-12 19:37:37 +00:00
|
|
|
- rm go$${GO_VERSION}.linux-amd64.tar.gz
|
|
|
|
- echo "GO $${GO_VERSION} INSTALLED"
|
|
|
|
- npm run project-setup
|
2024-09-12 08:48:17 +00:00
|
|
|
- npm install
|
2024-09-12 19:37:37 +00:00
|
|
|
- npm run build
|
2024-09-12 08:48:17 +00:00
|
|
|
|
|
|
|
- name: deploy
|
|
|
|
when:
|
|
|
|
event: [push]
|
2024-09-12 22:16:20 +00:00
|
|
|
branch: [main]
|
2024-09-12 08:48:17 +00:00
|
|
|
image: plugins/s3
|
|
|
|
settings:
|
2024-09-12 21:16:38 +00:00
|
|
|
bucket: chtinux.org
|
2024-09-12 08:48:17 +00:00
|
|
|
endpoint: https://garage.deuxfleurs.fr
|
|
|
|
region: garage
|
|
|
|
access_key:
|
|
|
|
from_secret: chtinux_aws_access_key_id
|
|
|
|
secret_key:
|
|
|
|
from_secret: chtinux_aws_secret_access_key
|
2024-09-12 21:16:38 +00:00
|
|
|
source: public/**/*
|
2024-09-12 08:48:17 +00:00
|
|
|
target: /
|
2024-09-12 21:16:38 +00:00
|
|
|
strip_prefix: public/
|
2024-09-12 08:48:17 +00:00
|
|
|
path_style: true
|