labels: hostname: "macmini7" clone: git: image: woodpeckerci/plugin-git settings: partial: false depth: 1 steps: build-staging: name: build-staging image: woodpeckerci/plugin-docker-buildx secrets: [REGISTRY_USER, REGISTRY_PASSWORD] volumes: - /var/run/docker.sock:/var/run/docker.sock commands: - echo "Building application for staging branch" - echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us - echo compose build - docker compose -f docker-compose.staging.yml build when: - branch: main - event: push - path: include: [ 'stack.production.yml', 'stack.staging.yml', 'docker-compose.staging.yml', 'docker-compose.production.yml', 'Dockerfile', '*.tests.ts' ] deploy-new: name: deploy-new when: - branch: main - path: include: [ 'stack.production.yml', 'stack.staging.yml', 'docker-compose.staging.yml', 'docker-compose.production.yml', 'Dockerfile', '*.tests.ts' ] image: woodpeckerci/plugin-docker-buildx secrets: [REGISTRY_USER, REGISTRY_PASSWORD] volumes: - /var/run/docker.sock:/var/run/docker.sock commands: - echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us - echo compose push - docker compose -f docker-compose.staging.yml push cleanup-staging: name: cleanup-staging when: - branch: main - path: include: [ 'stack.production.yml', 'stack.staging.yml', 'docker-compose.staging.yml', 'docker-compose.production.yml', 'Dockerfile', '*.tests.ts' ] image: woodpeckerci/plugin-docker-buildx secrets: [REGISTRY_USER, REGISTRY_PASSWORD] volumes: - /var/run/docker.sock:/var/run/docker.sock commands: - docker compose -f docker-compose.staging.yml down - docker compose -f docker-compose.staging.yml rm -f build-build-push-production: name: build-build-push-production image: woodpeckerci/plugin-docker-buildx secrets: [REGISTRY_USER, REGISTRY_PASSWORD] volumes: - /var/run/docker.sock:/var/run/docker.sock commands: - echo "Building application for staging branch" - echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us - echo compose build - docker compose -f docker-compose.production.yml build - docker compose -f docker-compose.production.yml push when: - branch: production - event: push - path: include: [ 'stack.production.yml', 'stack.staging.yml', 'docker-compose.staging.yml', 'docker-compose.production.yml', 'Dockerfile', '*.tests.ts' ] deploy-production: name: deploy-production image: woodpeckerci/plugin-docker-buildx secrets: [REGISTRY_USER, REGISTRY_PASSWORD] volumes: - /var/run/docker.sock:/var/run/docker.sock commands: - echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us when: - branch: production - event: push