pipeline { agent none stages { stage('Compile Tailwind CSS') { agent { docker { image 'node:26.3.1-alpine3.24' args '-v /tmp:/tmp -v /.npm:/.npm' } } steps { checkout scm sh ''' npm install tailwindcss @tailwindcss/cli @tailwindcss/forms npx tailwindcss -i static/input.css -o static/output.css --watch ''' stash name: 'tailwindcss-output', includes: 'static/output.css' } } stage('Build') { agent { kubernetes { defaultContainer 'kaniko' yaml """ apiVersion: v1 kind: Pod metadata: name: kaniko spec: containers: - name: kaniko image: gcr.io/kaniko-project/executor:v1.24.0-debug imagePullPolicy: Always command: [ /busybox/cat ] tty: true """ } } environment { IMAGE_PUSH_DESTINATION="registry.sayag.it/sayauz/web" } steps { checkout scm unstash 'tailwindcss-output' container(name: 'kaniko', shell: '/busybox/sh') { withCredentials([file(credentialsId: 'registry-sayagit-jenkins-password', variable: 'REGISTRY_SAYAGIT_JENKINS_PASSWORD')]) { withEnv(['PATH+EXTRA=/busybox']) { sh '''#!/busybox/sh docker login registry.sayag.it -u jenkins -p "$REGISTRY_SAYAGIT_JENKINS_PASSWORD" pushToTags="$IMAGE_PUSH_DESTINATION:latest $IMAGE_PUSH_DESTINATION:commit-`git rev-parse --short HEAD`" if [ "$TAG_NAME" != "" ]; then pushToTags="$pushToTags $IMAGE_PUSH_DESTINATION:stable $IMAGE_PUSH_DESTINATION:$TAG_NAME" fi /kaniko/executor --context `pwd` --destination $pushToTags ''' } } } } } } }