From c168300a926f2a708af3d11e664f78e41acf6986 Mon Sep 17 00:00:00 2001 From: Vahn Gomes Date: Wed, 4 Oct 2023 15:02:59 -0400 Subject: [PATCH] chore: Update Woodpecker configuration and pipeline steps --- .woodpecker.yml | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index b70f61d9..ef937e87 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,3 +1,11 @@ +when: + event: [push, tag, pull_request] + branch: + - main + - release/* + path: + exclude: ["README.md", "LICENSE", ".github", ".gitignore"] + variables: - &node_image "node:18" - &buildx_image "woodpeckerci/plugin-docker-buildx" @@ -12,27 +20,27 @@ services: ports: - 27017:27017 -pipeline: - - name: Generate version file +steps: + Generate version file: image: alpine/git commands: - git describe --always --tags > version - - name: Install Backend Dependencies + Install Backend Dependencies: image: *node_image commands: - cd backend - npm install - cd .. - - name: Install Frontend Dependencies + Install Frontend Dependencies: image: *node_image commands: - cd frontend - npm install - cd .. - - name: Test Backend + Test Backend: image: *node_image environment: SESSION_SECRET: 64ee54e91d5ea65c2fff46f7bf0d6b2c @@ -47,28 +55,28 @@ pipeline: - npm test - cd .. - - name: Test Frontend + Test Frontend: image: *node_image commands: - cd frontend - npm run test:unit - cd .. - - name: Lint Backend + Lint Backend: image: *node_image commands: - cd backend - npm run lint - cd .. - - name: Lint Frontend + Lint Frontend: image: *node_image commands: - cd frontend - npm run lint - cd .. - - name: Deploy to Docker Hub + Deploy to Docker Hub: image: *buildx_image secrets: [docker_username, docker_password] settings: @@ -79,7 +87,7 @@ pipeline: when: event: push - - name: Deploy Tagged Version + Deploy Tagged Version: image: *buildx_image secrets: [docker_username, docker_password] settings: @@ -90,7 +98,7 @@ pipeline: when: event: tag - - name: Deploy Pull Request + Deploy Pull Request: image: *buildx_image secrets: [docker_username, docker_password] settings: @@ -100,6 +108,3 @@ pipeline: tag: pull_${CI_COMMIT_PULL_REQUEST} when: event: pull_request - -branches: [main] -ignore_paths: [README.md, LICENSE, .github, .gitignore]