5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 07:16:21 +00:00
panel/.woodpecker.yml

73 lines
2.2 KiB
YAML
Raw Normal View History

2022-04-13 15:31:36 +00:00
pipeline:
publish:
2023-04-06 14:19:33 +00:00
image: "docker.io/woodpeckerci/plugin-docker-buildx"
2022-04-13 15:31:36 +00:00
settings:
2023-04-06 14:19:33 +00:00
registry: "gitea.nulo.in"
2023-03-14 22:15:26 +00:00
username: "sutty"
2023-04-06 14:19:33 +00:00
repo: "gitea.nulo.in/sutty/panel"
2022-04-13 15:31:36 +00:00
tags:
2023-04-11 19:37:24 +00:00
- "${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH}-${CI_COMMIT_BRANCH}"
2023-03-14 22:15:26 +00:00
- "latest"
2022-04-13 15:31:36 +00:00
build_args:
2023-03-14 22:15:26 +00:00
- "RUBY_VERSION=${RUBY_VERSION}"
- "RUBY_PATCH=${RUBY_PATCH}"
- "ALPINE_VERSION=${ALPINE_VERSION}"
2023-04-06 14:19:33 +00:00
- "BASE_IMAGE=gitea.nulo.in/sutty/rails"
2022-04-13 15:31:36 +00:00
purge: false
secrets:
2023-04-06 14:19:33 +00:00
- "DOCKER_PASSWORD"
2022-04-13 15:31:36 +00:00
when:
2022-04-13 15:37:13 +00:00
branch:
2023-03-14 22:15:26 +00:00
- "rails"
- "panel.sutty.nl"
event: "push"
path:
include:
- "Dockerfile"
- ".dockerignore"
2023-04-11 19:39:10 +00:00
- ".woodpecker.yml"
2023-03-14 23:26:07 +00:00
assets:
2023-04-06 14:19:33 +00:00
image: "gitea.nulo.in/sutty/panel:${ALPINE_VERSION}-${RUBY_VERSION}.${RUBY_PATCH}"
2023-03-14 23:26:07 +00:00
commands:
- "apk add python2 dotenv openssh-client brotli"
- "install -d -m 700 ~/.ssh/"
- "echo \"$${KNOWN_HOSTS}\" | base64 -d >> ~/.ssh/known_hosts"
- "chmod 600 ~/.ssh/known_hosts"
2023-03-14 23:26:07 +00:00
- "eval $(ssh-agent -s)"
- "echo \"$${SSH_KEY}\" | base64 -d | ssh-add -"
- "ssh $${ORIGIN%:*}"
2023-03-14 23:26:07 +00:00
- "git config user.name Woodpecker"
- "git config user.email ci@sutty.coop.ar"
2023-03-15 14:23:35 +00:00
- "git remote add upstream $${ORIGIN}"
2023-03-14 23:26:07 +00:00
- "git checkout -B ${CI_COMMIT_BRANCH}"
- "mv config/credentials.yml.enc.ci config/credentials.yml.enc"
2023-03-14 23:26:07 +00:00
- "yarn"
- "cp .env.example .env"
- "dotenv bundle install --path=vendor"
- "dotenv RAILS_ENV=production bundle exec rails webpacker:clobber"
2023-03-16 13:18:42 +00:00
- "dotenv RAILS_ENV=production bundle exec rails assets:precompile"
- "dotenv RAILS_ENV=production bundle exec rails assets:clean"
2023-03-31 21:16:11 +00:00
- "find public -type f -print0 | xargs -r0 brotli -k9f"
2023-03-14 23:26:07 +00:00
- "git add public && git commit -m \"ci: assets [skip ci]\""
2023-03-30 13:27:30 +00:00
- "git pull upstream ${CI_COMMIT_BRANCH}"
2023-03-15 14:23:35 +00:00
- "git push upstream ${CI_COMMIT_BRANCH}"
2023-03-14 23:26:07 +00:00
secrets:
- "SSH_KEY"
- "KNOWN_HOSTS"
- "ORIGIN"
when:
branch:
- "rails"
- "panel.sutty.nl"
path:
include:
- "app/assets/**/*"
- "app/javascript/**/*"
- "package.json"
- "yarn.lock"
2022-04-13 15:31:36 +00:00
matrix:
include:
2023-04-06 14:19:33 +00:00
- ALPINE_VERSION: "3.14.10"
2023-03-14 22:15:26 +00:00
RUBY_VERSION: "2.7"
2023-04-06 14:19:33 +00:00
RUBY_PATCH: "8"