71 lines
1.9 KiB
YAML
71 lines
1.9 KiB
YAML
steps:
|
|
debug-secrets:
|
|
image: alpine
|
|
environment:
|
|
# TOKEN PAT: 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
|
|
GITHUB_PAT: from_secret:GITHUB_PAT
|
|
GITHUB_USERNAME: from_secret:GITHUB_USERNAME
|
|
commands:
|
|
- echo "GITHUB_USERNAME is set: ${GITHUB_USERNAME:+yes}"
|
|
- echo "GITHUB_PAT is set: ${GITHUB_PAT:+yes}"
|
|
- echo "GITHUB_PAT starts with: ${GITHUB_PAT:0:4}****"
|
|
when:
|
|
event: [push, pull_request, manual]
|
|
|
|
docker-login:
|
|
image: docker
|
|
environment:
|
|
# TOKEN PAT: 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
|
|
GITHUB_PAT: from_secret:GITHUB_PAT
|
|
GITHUB_USERNAME: from_secret:GITHUB_USERNAME
|
|
commands:
|
|
- echo $GITHUB_PAT | docker login ghcr.io -u $GITHUB_USERNAME --password-stdin
|
|
when:
|
|
event: [push, pull_request, manual]
|
|
|
|
restore-cache:
|
|
image: plugins/cache
|
|
settings:
|
|
restore: true
|
|
mount:
|
|
- /root/.m2
|
|
- frontend/node_modules
|
|
path: /tmp/woodpecker-cache
|
|
when:
|
|
event: [push, pull_request, manual]
|
|
|
|
backend-build:
|
|
image: maven:3.9-eclipse-temurin-17
|
|
volumes:
|
|
- build:/output
|
|
commands:
|
|
- echo "Building backend + frontend"
|
|
- mvn clean install -Pprod -DskipTests
|
|
- cp target/resilient*.jar /output/
|
|
when:
|
|
event: [push, pull_request, manual]
|
|
branch:
|
|
include:
|
|
- main
|
|
- master
|
|
- develop
|
|
|
|
save-cache:
|
|
image: plugins/cache
|
|
settings:
|
|
rebuild: true
|
|
mount:
|
|
- /root/.m2
|
|
- frontend/node_modules
|
|
path: /tmp/woodpecker-cache
|
|
when:
|
|
event: [push, pull_request, manual]
|
|
|
|
save-artifacts:
|
|
image: ghcr.io/woodpecker-ci/plugin-artifacts
|
|
settings:
|
|
files:
|
|
- /output/resilient*.jar
|
|
destination: build
|
|
when:
|
|
event: [push, pull_request, manual]
|