Compare commits

...

18 commits

Author SHA1 Message Date
268081b28b
Merge pull request 'fix: actually provide maven profile' (!50) from feature/esb-deploy-action into main
Reviewed-on: #50
Reviewed-by: Kraft_Ruben_-_J._Schmalz_GmbH <Ruben.Kraft@schmalz.de>
2026-06-17 07:50:35 +00:00
9783972537 fix: actually provide maven profile
All checks were successful
Aikido Security PR Check / Aikido Security Scan (pull_request) Successful in 59s
validate-shared-actions / validate-shared-actions (pull_request) Successful in 41s
2026-06-17 09:41:57 +02:00
ee976b306e
Merge pull request 'feature/esb-deploy-action' (!49) from feature/esb-deploy-action into main
Reviewed-on: #49
2026-06-17 06:54:26 +00:00
a49611f288 fix: maven action did not set profile in verify mode
All checks were successful
Aikido Security PR Check / Aikido Security Scan (pull_request) Successful in 57s
validate-shared-actions / validate-shared-actions (pull_request) Successful in 35s
2026-06-17 08:52:37 +02:00
9149415575 fix: action did not provide stage toggle 2026-06-17 08:01:38 +02:00
6a84d5d6f2
Merge pull request 'fix: readme mentioned wrong parameters' (!48) from feature/esb-deploy-action into main
Reviewed-on: #48
Reviewed-by: Kraft_Ruben_-_J._Schmalz_GmbH <Ruben.Kraft@schmalz.de>
2026-06-17 05:46:13 +00:00
0134da8ac7 fix: propagate maven profile in esb-deploy action
All checks were successful
Aikido Security PR Check / Aikido Security Scan (pull_request) Successful in 57s
validate-shared-actions / validate-shared-actions (pull_request) Successful in 42s
2026-06-17 07:42:35 +02:00
115300a7e1 fix: readme mentioned wrong parameters
All checks were successful
validate-shared-actions / validate-shared-actions (pull_request) Successful in 1m57s
Aikido Security PR Check / Aikido Security Scan (pull_request) Successful in 2m16s
2026-06-16 16:32:34 +02:00
c57466f628
Merge pull request 'fix: use correct name in tag-release workflow' (!47) from feature/esb-deploy-action into main
Reviewed-on: #47
Reviewed-by: Kraft_Ruben_-_J._Schmalz_GmbH <Ruben.Kraft@schmalz.de>
2026-06-16 14:27:06 +00:00
4e15383d23 fix: use correct name in tag-release workflow
All checks were successful
validate-shared-actions / validate-shared-actions (pull_request) Successful in 38s
Aikido Security PR Check / Aikido Security Scan (pull_request) Successful in 51s
2026-06-16 16:25:43 +02:00
c2587887a0
Merge pull request 'feat: create deploy-esb action' (!46) from feature/esb-deploy-action into main
Reviewed-on: #46
Reviewed-by: Kraft_Ruben_-_J._Schmalz_GmbH <Ruben.Kraft@schmalz.de>
2026-06-16 14:23:52 +00:00
5b6f2cfd28 feat: create deploy-esb action
All checks were successful
validate-shared-actions / validate-shared-actions (pull_request) Successful in 53s
Aikido Security PR Check / Aikido Security Scan (pull_request) Successful in 1m14s
2026-06-16 16:06:32 +02:00
f6549e5a5b
Merge pull request 'fix: revert workspace selection as validate does not initialize backend' (!45) from fix/terraform-validate-backend-error into main
Reviewed-on: #45
Reviewed-by: Marcel Frey <Marcel.Frey@schmalz.de>
2026-06-15 07:29:40 +00:00
36343e0a79 fix: revert workspace selection as validate does not initialize backend
All checks were successful
validate-shared-actions / validate-shared-actions (pull_request) Successful in 32s
Aikido Security PR Check / Aikido Security Scan (pull_request) Successful in 48s
2026-06-15 09:28:00 +02:00
463f657b4a
Merge pull request 'fix: create terraform workspaces automatically in shared actions' (!44) from fix/terraform-workspace-or-create into main
Reviewed-on: #44
Reviewed-by: Böhringer_Sebastian_-_J._Schmalz_GmbH <Sebastian.Boehringer@schmalz.de>
2026-06-15 06:46:11 +00:00
312d297a55 fix: create terraform workspaces automatically in shared actions
All checks were successful
Aikido Security PR Check / Aikido Security Scan (pull_request) Successful in 1m5s
validate-shared-actions / validate-shared-actions (pull_request) Successful in 41s
2026-06-15 12:09:09 +05:30
add4dd1b95
Merge pull request 'feat: add publish actions with documentation' (!42) from feature/publish into main
Reviewed-on: #42
Reviewed-by: Böhringer_Sebastian_-_J._Schmalz_GmbH <Sebastian.Boehringer@schmalz.de>
2026-06-11 08:23:20 +00:00
801c7e2249 feat: add publish actions with documentation
All checks were successful
Aikido Security PR Check / Aikido Security Scan (pull_request) Successful in 1m5s
validate-shared-actions / validate-shared-actions (pull_request) Successful in 47s
2026-06-11 07:34:01 +00:00
10 changed files with 289 additions and 1 deletions

View file

@ -19,6 +19,7 @@ on:
- cache
- checkout
- download-artifact
- esb-deploy
- helm-deploy
- i18n-sync
- inject-content
@ -26,6 +27,8 @@ on:
- pnpm-build
- playwright-merge
- playwright-run
- publish-npm-package
- publish-rust-crate
- publish-static-contents
- rust-build
- terraform-apply

View file

@ -19,6 +19,8 @@ Shared actions for Forgejo CI/CD pipelines.
| [pnpm-build](pnpm-build) | Action for building and validating with PNPM |
| [playwright-merge](playwright-merge) | Merge Playwright shard blob reports and publish consolidated reports |
| [playwright-run](playwright-run) | Run Playwright tests for one shard and upload its blob report |
| [publish-npm-package](publish-npm-package) | Publish a PNPM package to JFrog Artifactory |
| [publish-rust-crate](publish-rust-crate) | Publish a Rust crate to JFrog Artifactory |
| [publish-static-contents](publish-static-contents) | Syncs frontend assets to S3 and invalidates a CloudFront distribution |
| [rust-build](rust-build) | Set up Rust toolchain, run checks, and build via the project's build.sh |
| [terraform-apply](terraform-apply) | Apply Terraform configuration files using the official Terraform CLI |

32
esb-deploy/README.md Normal file
View file

@ -0,0 +1,32 @@
# esb-deploy
Deploy a service to an ESB docker host.
## Inputs
| Input | Required | Default | Description |
|-------|----------|---------|-------------|
| `docker-host` | Yes | - | esbdb3.schmalzgroup.net, esbdb4.schmalzgroup.net, esbdb2-stage.schmalzgroup.net|
| `java-version` | Yes | 25 | Same as default of the maven-build action |
| `maven-profile` | No | `test` | Maven profile to activate during deploy |
| `maven-settings` | **Yes** | — | Secret containing the `settings.xml` content used for repository authentication |
| `service` | Yes | — | Name of the service to deploy |
| `stage` | No | true | If true this is a stage deployment |
## Usage
```yaml
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/esb-deploy@esb-deploy-v1
with:
service: my-service
docker-host: esbdocker2-stage.schmalzgroup.net
java-version: 8
maven-profile: test
maven-settings: ${{ secrets.MAVEN_SETTINGS }}
stage: true
```
## Notes
- The compose files are extracted from variables. They can be provided on the organization or repository level.
- The action uses the maven-build action to build the service. The pom.xml has to be in the root directory

64
esb-deploy/action.yml Normal file
View file

@ -0,0 +1,64 @@
name: Deploy ESB
description: Deploy a service to an ESB docker host.
inputs:
docker-host:
description: Docker host to deploy to
required: true
maven-profile:
required: false
default: 'test'
description: 'Maven profile to use for the build'
maven-settings:
description: Secret containing the settings.xml content used for repository authentication
required: true
java-version:
description: Java version to use for the build
required: true
service:
description: Name of the service to deploy
required: true
stage:
description: Whether to deploy to stage environment (true) or production environment (false)
required: false
default: 'true'
runs:
using: composite
steps:
- name: Create compose files
shell: bash
env:
BASE_COMPOSE: ${{ vars.DOCKER_COMPOSE }}
SU_COMPOSE: ${{ vars.DOCKER_COMPOSE_SU }}
run: |
printf '%s\n' "$BASE_COMPOSE" > compose.yml
printf '%s\n' "$SU_COMPOSE" > compose-su.yml
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/maven-build@maven-build-v1
with:
phase: verify
maven-settings: ${{ inputs.maven-settings }}
verify-goals: clean package
java-version: ${{ inputs.java-version }}
maven-profile: ${{ inputs.maven-profile}}
- name: Compose stage
if: ${{ inputs.stage == 'true' }}
shell: bash
env:
SERVICE: ${{ inputs.service }}
run: |
echo "Deploying $SERVICE to stage environment"
export DOCKER_HOST="tcp://${{ inputs.docker-host }}:2375"
docker compose -f compose.yml -f compose-su.yml up -d --build --no-deps "$SERVICE"
- name: Compose prod
if: ${{ inputs.stage != 'true' }}
shell: bash
env:
SERVICE: ${{ inputs.service }}
run: |
echo "Deploying $SERVICE to production environment"
export DOCKER_HOST="tcp://${{ inputs.docker-host }}:2375"
docker compose -f compose.yml up -d --build --no-deps "$SERVICE"

View file

@ -94,9 +94,11 @@ runs:
env:
VERIFY_GOALS: ${{ inputs.verify-goals }}
EXTRA_ARGS: ${{ inputs.extra-args }}
MAVEN_PROFILE: ${{ inputs.maven-profile }}
run: |
mvn --batch-mode $VERIFY_GOALS \
-s /tmp/maven-settings.xml \
-P "$MAVEN_PROFILE" \
$EXTRA_ARGS
- name: Deploy

View file

@ -0,0 +1,28 @@
# publish-npm-package
Publish a PNPM package to JFrog Artifactory.
## Inputs
| Input | Required | Default | Description |
|-------|----------|---------|-------------|
| `working-directory` | No | `.` | Directory containing `package.json` |
| `node-version` | No | `24` | Node.js version |
| `pnpm-version` | No | `10.33` | pnpm version |
| `jfrog-token` | Yes | — | JFrog npm auth token |
| `registry-url` | No | `https://schmalz.jfrog.io/artifactory/api/npm/default-npm/` | npm registry URL |
## Usage
```yaml
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/publish-npm-package@publish-npm-package-v1
with:
working-directory: .
jfrog-token: ${{ secrets.JFROG_TOKEN }}
```
## Notes
- Publishes with `pnpm publish`.
- Configures the registry auth token from `registry-url` and `jfrog-token`.
- Third-party actions used internally are pinned to exact commit SHAs to prevent supply chain attacks.

View file

@ -0,0 +1,64 @@
name: publish-npm-package
description: Publish a PNPM package to JFrog Artifactory.
inputs:
working-directory:
description: Directory containing package.json
required: false
default: "."
node-version:
description: Node.js version
required: false
default: "24"
pnpm-version:
description: pnpm version
required: false
default: "10.33"
jfrog-token:
description: JFrog npm auth token
required: true
registry-url:
description: npm registry URL
required: false
default: "https://schmalz.jfrog.io/artifactory/api/npm/default-npm/"
runs:
using: composite
steps:
# Pinned to commit SHA instead of a tag to prevent supply chain attacks.
# actions/setup-node v4.4.0 — https://code.forgejo.org/actions/setup-node/commits/tag/v4.4.0
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: ${{ inputs.node-version }}
# Pinned to commit SHA instead of a tag to prevent supply chain attacks.
# pnpm/action-setup v4.3.0 — https://code.forgejo.org/pnpm/action-setup/commits/tag/v4.3.0
- name: Install pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1
env:
# pnpm/action-setup bootstraps itself via npm before pnpm is available,
# so it must reach the public npm registry.
NPM_CONFIG_REGISTRY: https://registry.npmjs.org
with:
version: ${{ inputs.pnpm-version }}
- name: Configure JFrog registry authentication
shell: bash
env:
JFROG_TOKEN: ${{ inputs.jfrog-token }}
REGISTRY_URL: ${{ inputs.registry-url }}
run: |
set -euo pipefail
pnpm set registry "${REGISTRY_URL}"
AUTHORITY="${REGISTRY_URL#https://}"
AUTHORITY="${AUTHORITY#http://}"
AUTHORITY="${AUTHORITY%/}"
pnpm set "//${AUTHORITY}/:_authToken" "${JFROG_TOKEN}"
- name: Publish
shell: bash
working-directory: ${{ inputs.working-directory }}
run: pnpm publish

View file

@ -0,0 +1,29 @@
# publish-rust-crate
Publish a Rust crate to JFrog Artifactory.
## Inputs
| Input | Required | Default | Description |
|-------|----------|---------|-------------|
| `working-directory` | No | `.` | Directory containing `Cargo.toml` |
| `rust-version` | No | `1.95.0` | Rust toolchain version |
| `jfrog-token` | Yes | — | JFrog token for the Artifactory Cargo registry |
| `registry-name` | No | `artifactory` | Cargo registry name |
| `registry-index` | No | `sparse+https://schmalz.jfrog.io/artifactory/api/cargo/schmalz-cargo-local/index/` | Cargo registry index URL |
## Usage
```yaml
- uses: https://schmalz-git.git.onstackit.cloud/schmalz/shared-actions/publish-rust-crate@publish-rust-crate-v1
with:
working-directory: .
jfrog-token: ${{ secrets.JFROG_TOKEN }}
```
## Notes
- Configures Cargo registry settings in `${CARGO_HOME}/config.toml` and `${CARGO_HOME}/credentials.toml`.
- Falls back to `$HOME/.cargo` when `CARGO_HOME` is not set.
- Publishes with `cargo publish --registry <registry-name>`.
- Third-party actions used internally are pinned to exact commit SHAs to prevent supply chain attacks.

View file

@ -0,0 +1,64 @@
name: publish-rust-crate
description: Publish a Rust crate to JFrog Artifactory.
inputs:
working-directory:
description: Directory containing Cargo.toml
required: false
default: "."
rust-version:
description: Rust toolchain version
required: false
default: "1.95.0"
jfrog-token:
description: JFrog token for the Artifactory Cargo registry
required: true
registry-name:
description: Cargo registry name
required: false
default: artifactory
registry-index:
description: Cargo registry index URL
required: false
default: "sparse+https://schmalz.jfrog.io/artifactory/api/cargo/schmalz-cargo-local/index/"
runs:
using: composite
steps:
# Pinned to commit SHA instead of a tag to prevent supply chain attacks.
# dtolnay/rust-toolchain v1 (2026-03-27) — https://github.com/dtolnay/rust-toolchain/commit/3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: ${{ inputs.rust-version }}
- name: Configure Cargo registry (JFrog Artifactory)
shell: bash
env:
JFROG_TOKEN: ${{ inputs.jfrog-token }}
REGISTRY_NAME: ${{ inputs.registry-name }}
REGISTRY_INDEX: ${{ inputs.registry-index }}
run: |
set -euo pipefail
CARGO_HOME_DIR="${CARGO_HOME:-$HOME/.cargo}"
mkdir -p "${CARGO_HOME_DIR}"
cat >> "${CARGO_HOME_DIR}/config.toml" <<EOF
[registries.${REGISTRY_NAME}]
index = "${REGISTRY_INDEX}"
[registry]
global-credential-providers = ["cargo:token"]
EOF
cat >> "${CARGO_HOME_DIR}/credentials.toml" <<EOF
[registries.${REGISTRY_NAME}]
token = "Bearer ${JFROG_TOKEN}"
EOF
- name: Publish
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
REGISTRY_NAME: ${{ inputs.registry-name }}
run: cargo publish --registry "${REGISTRY_NAME}"

View file

@ -61,7 +61,7 @@ runs:
TF_DIR: ${{ inputs.terraform-dir }}
TF_WORKSPACE_NAME: ${{ inputs.workspace }}
run: |
terraform -chdir="$TF_DIR" workspace select "$TF_WORKSPACE_NAME"
terraform -chdir="$TF_DIR" workspace select -or-create "$TF_WORKSPACE_NAME"
- name: Terraform Apply
shell: bash