mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-18 10:29:43 +00:00
e45a354eef
Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/318 Co-authored-by: pat-s <patrick.schratz@gmail.com> Co-committed-by: pat-s <patrick.schratz@gmail.com>
129 lines
2.9 KiB
YAML
129 lines
2.9 KiB
YAML
when:
|
|
- event: [pull_request, tag, cron]
|
|
- event: push
|
|
branch:
|
|
- ${CI_REPO_DEFAULT_BRANCH}
|
|
- renovate/*
|
|
|
|
depends_on:
|
|
- lint
|
|
|
|
steps:
|
|
# use vendor to cache dependencies
|
|
vendor:
|
|
image: golang:1.21
|
|
commands:
|
|
- go mod vendor
|
|
|
|
build:
|
|
depends_on: vendor
|
|
image: codeberg.org/6543/docker-images/golang_just
|
|
commands:
|
|
- go version
|
|
- just build
|
|
when:
|
|
- event: [push, pull_request]
|
|
branch:
|
|
- ${CI_REPO_DEFAULT_BRANCH}
|
|
- renovate/*
|
|
|
|
docker-dryrun:
|
|
depends_on: vendor
|
|
image: plugins/kaniko:1.8.8
|
|
settings:
|
|
dockerfile: Dockerfile
|
|
no_push: true
|
|
tags: latest
|
|
when:
|
|
- event: [push, pull_request]
|
|
branch:
|
|
- ${CI_REPO_DEFAULT_BRANCH}
|
|
- renovate/*
|
|
path: Dockerfile
|
|
|
|
build-tag:
|
|
depends_on: vendor
|
|
image: codeberg.org/6543/docker-images/golang_just
|
|
commands:
|
|
- go version
|
|
- just build-tag ${CI_COMMIT_TAG##v}
|
|
when:
|
|
- event: ["tag"]
|
|
branch:
|
|
- ${CI_REPO_DEFAULT_BRANCH}
|
|
|
|
test:
|
|
depends_on: build
|
|
image: codeberg.org/6543/docker-images/golang_just
|
|
commands:
|
|
- just test
|
|
when:
|
|
- event: pull_request
|
|
- event: push
|
|
branch: renovate/*
|
|
|
|
integration-tests:
|
|
depends_on: build
|
|
image: codeberg.org/6543/docker-images/golang_just
|
|
commands:
|
|
- just integration
|
|
environment:
|
|
- ACME_API=https://acme.mock.directory
|
|
- PAGES_DOMAIN=localhost.mock.directory
|
|
- RAW_DOMAIN=raw.localhost.mock.directory
|
|
- PORT=4430
|
|
when:
|
|
- event: pull_request
|
|
- event: push
|
|
branch: renovate/*
|
|
|
|
release:
|
|
depends_on: build
|
|
image: plugins/gitea-release:0.3.1
|
|
settings:
|
|
base_url: https://codeberg.org
|
|
file_exists: overwrite
|
|
files: build/codeberg-pages-server
|
|
api_key:
|
|
from_secret: bot_token
|
|
environment:
|
|
- CI_REPO_OWNER=${CI_REPO_OWNER}
|
|
- CI_REPO_NAME=${CI_REPO_NAME}
|
|
- CI_BUILD_EVENT=${CI_BUILD_EVENT}
|
|
- CI_COMMIT_REF=${CI_COMMIT_REF}
|
|
when:
|
|
- event: ["tag"]
|
|
branch:
|
|
- ${CI_REPO_DEFAULT_BRANCH}
|
|
|
|
docker-next:
|
|
depends_on: vendor
|
|
image: plugins/kaniko:1.8.8
|
|
settings:
|
|
registry: codeberg.org
|
|
dockerfile: Dockerfile
|
|
repo: codeberg.org/codeberg/pages-server
|
|
tags: next
|
|
username:
|
|
from_secret: bot_user
|
|
password:
|
|
from_secret: bot_token
|
|
when:
|
|
- event: ["push"]
|
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
|
|
docker-tag:
|
|
depends_on: vendor
|
|
image: plugins/kaniko:1.8.8
|
|
settings:
|
|
registry: codeberg.org
|
|
dockerfile: Dockerfile
|
|
repo: codeberg.org/codeberg/pages-server
|
|
tags: [latest, "${CI_COMMIT_TAG}"]
|
|
username:
|
|
from_secret: bot_user
|
|
password:
|
|
from_secret: bot_token
|
|
when:
|
|
- event: ["push"]
|
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|