40 lines
917 B
YAML
40 lines
917 B
YAML
pipeline:
|
|
build:
|
|
image: node:16-alpine
|
|
commands:
|
|
- npm i
|
|
- sed -i "s#APP_BASE_URL = '/'#APP_BASE_URL = '/og-image'#" webpack.config.js src/router.js
|
|
- npm run build
|
|
when:
|
|
branch: [main]
|
|
|
|
update:
|
|
image: alpine/git
|
|
commands:
|
|
- git fetch --no-tags origin +refs/heads/pages
|
|
- git config --global user.email ci@gitnet.fr
|
|
- git config --global user.name CI
|
|
- git add .
|
|
- git commit -m "Build"
|
|
- git switch pages
|
|
- mv public /tmp/
|
|
- rm * -fr
|
|
- mv /tmp/public/* .
|
|
- git add .
|
|
- git commit -m "Build ${CI_BUILD_NUMBER}"
|
|
when:
|
|
branch: [main]
|
|
|
|
deploy:
|
|
image: appleboy/drone-git-push
|
|
commands:
|
|
settings:
|
|
branch: pages
|
|
remote: git@gitnet.fr:deblan/og-image.git
|
|
force: false
|
|
commit: false
|
|
ssh_key:
|
|
from_secret: ssh_priv_key
|
|
when:
|
|
branch: [main]
|