feat: improve CI config

This commit is contained in:
Yarmo Mackenbach 2024-06-02 16:41:03 +02:00
parent 1e1a02fb99
commit bda71db95d
No known key found for this signature in database
GPG key ID: C248C28D432560ED
4 changed files with 48 additions and 57 deletions

View file

@ -1,57 +0,0 @@
steps:
test:
image: node
commands:
- yarn --pure-lockfile
- yarn run test
build-latest-container:
when:
branch: main
event: tag
image: plugins/docker
settings:
registry: https://codeberg.org/v2
username:
from_secret: codeberg_username
password:
from_secret: codeberg_password
repo: codeberg.org/keyoxide/keyoxide-web
tags: latest
build_args_from_env:
- CI_COMMIT_SHA
- CI_COMMIT_BRANCH
build-tag-container:
when:
branch: main
event: tag
image: plugins/docker
settings:
registry: https://codeberg.org/v2
username:
from_secret: codeberg_username
password:
from_secret: codeberg_password
repo: codeberg.org/keyoxide/keyoxide-web
auto_tag: true
build_args_from_env:
- CI_COMMIT_SHA
- CI_COMMIT_BRANCH
build-dev-container:
when:
branch: dev
event: push
image: plugins/docker
settings:
registry: https://codeberg.org/v2
username:
from_secret: codeberg_username
password:
from_secret: codeberg_password
repo: codeberg.org/keyoxide/keyoxide-web
tags: dev
build_args_from_env:
- CI_COMMIT_SHA
- CI_COMMIT_BRANCH

View file

@ -0,0 +1,20 @@
when:
branch: dev
event: push
steps:
build-latest-container:
image: woodpeckerci/plugin-docker-buildx
settings:
registry: https://codeberg.org/v2
username:
from_secret: codeberg_username
password:
from_secret: codeberg_password
repo: codeberg.org/keyoxide/keyoxide-web
tag: dev
build_args_from_env:
- CI_COMMIT_SHA
- CI_COMMIT_BRANCH
depends_on:
- test

20
.woodpecker/.release.yml Normal file
View file

@ -0,0 +1,20 @@
when:
branch: main
event: tag
steps:
build-latest-container:
image: woodpeckerci/plugin-docker-buildx
settings:
registry: https://codeberg.org/v2
username:
from_secret: codeberg_username
password:
from_secret: codeberg_password
repo: codeberg.org/keyoxide/keyoxide-web
auto_tag: true
build_args_from_env:
- CI_COMMIT_SHA
- CI_COMMIT_BRANCH
depends_on:
- test

8
.woodpecker/.test.yml Normal file
View file

@ -0,0 +1,8 @@
when:
event: [push, pull_request, tag, release, manual]
steps:
test:
image: node:20
commands:
- npm ci
- npm test