Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
267bc070ab
|
|
@ -3,6 +3,8 @@ pipeline {
|
|||
|
||||
environment {
|
||||
NODE_VERSION = '20.17.0'
|
||||
PR_NUMBER = "${env.CHANGE_ID}" // PR number comes from webhook payload
|
||||
IMAGE_TAG="ghcr.io/gitroomhq/postiz-app-pr:${env.CHANGE_ID}"
|
||||
}
|
||||
|
||||
stages {
|
||||
|
|
@ -32,6 +34,28 @@ pipeline {
|
|||
sh 'npm run build'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build and Push Docker Image') {
|
||||
when {
|
||||
expression { return env.CHANGE_ID != null } // Only run if it's a PR
|
||||
}
|
||||
steps {
|
||||
withCredentials([string(credentialsId: 'gh-pat', variable: 'GITHUB_PASS')]) {
|
||||
// Docker login step
|
||||
sh '''
|
||||
echo "$GITHUB_PASS" | docker login ghcr.io -u "egelhaus" --password-stdin
|
||||
'''
|
||||
// Build Docker image
|
||||
sh '''
|
||||
docker build -f Dockerfile.dev -t $IMAGE_TAG .
|
||||
'''
|
||||
// Push Docker image to GitHub Container Registry
|
||||
sh '''
|
||||
docker push $IMAGE_TAG
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
v1.38.1
|
||||
v1.39.1
|
||||
|
|
|
|||
Loading…
Reference in New Issue