From 450ac8e6494a3aaaf9cf3472bb728a01042f8e7f Mon Sep 17 00:00:00 2001 From: Arvind verma <7758732+techiarvind@users.noreply.github.com> Date: Tue, 27 Jan 2026 16:19:23 +0530 Subject: [PATCH 1/5] Delete .github/workflows/docker.yml --- .github/workflows/docker.yml | 47 ------------------------------------ 1 file changed, 47 deletions(-) delete mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 2eb09ddc..00000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Build Docker Images - -on: - push: - tags: - - "*.*.*" - -jobs: - build: - runs-on: ubuntu-24.04-arm - timeout-minutes: 30 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: docuseal/docuseal - tags: type=semver,pattern={{version}} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Create .version file - run: echo ${{ github.ref_name }} > .version - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: . - push: true - platforms: linux/amd64,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} From 0433b4798282f2a7645738596d2c31bec10ba5aa Mon Sep 17 00:00:00 2001 From: Arvind verma <7758732+techiarvind@users.noreply.github.com> Date: Tue, 27 Jan 2026 18:55:16 +0530 Subject: [PATCH 2/5] Refactor CI workflow for deployment integration Updated CI workflow to include deployment step and removed redundant jobs. --- .github/workflows/ci.yml | 192 ++++----------------------------------- 1 file changed, 20 insertions(+), 172 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 754d06ad..873e3f09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,179 +1,27 @@ ---- -name: CI -on: [push] +name: Prod Pipeline + +on: + push: + branches: ["master"] jobs: - rubocop: - name: Rubocop + Deploy: runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.4.2 - - name: Cache gems - uses: actions/cache@v4 - with: - path: vendor/bundle - key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gem- - - name: Install gems - run: | - gem install bundler - bundle config path vendor/bundle - bundle install --jobs 4 --retry 4 - - name: Run RuboCop - run: bundle exec rubocop - erblint: - name: Erblint - runs-on: ubuntu-latest - timeout-minutes: 10 steps: - - uses: actions/checkout@v4 - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.4.2 - - name: Cache gems - uses: actions/cache@v4 - with: - path: vendor/bundle - key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gem- - - name: Install gems - run: | - gem install bundler - bundle config path vendor/bundle - bundle install --jobs 4 --retry 4 - - name: Run Erblint - run: bundle exec erb_lint ./app + - name: Checkout code + uses: actions/checkout@v4 - eslint: - name: ESLint - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - - name: Install Node.js - uses: actions/setup-node@v1 - with: - node-version: 20.9.0 - - name: Cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v4 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Install dependencies - run: | - yarn install - - name: Run eslint - run: | - ./node_modules/eslint/bin/eslint.js "app/javascript/**/*.js" - brakeman: - name: Brakeman - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v4 - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.4.2 - - name: Cache gems - uses: actions/cache@v4 - with: - path: vendor/bundle - key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gem- - - name: Install gems - run: | - gem install bundler - bundle config path vendor/bundle - bundle install --jobs 4 --retry 4 - yarn install - sudo apt-get update - sudo apt-get install libvips - - name: Run Brakeman - run: bundle exec brakeman -q --exit-on-warn - - rspec: - name: RSpec - runs-on: ubuntu-latest - timeout-minutes: 10 - - services: - postgres: - image: postgres:14 - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: docuseal_test - ports: ["5432:5432"] - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - - steps: - - uses: actions/checkout@v4 - - name: Install Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.4.2 - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: 20.9.0 - - name: Install Chrome - uses: browser-actions/setup-chrome@latest - with: - chrome-version: 125 - - name: Cache node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} - - name: Cache gems - uses: actions/cache@v4 - with: - path: vendor/bundle - key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gem- - - name: Install dependencies - env: - RAILS_ENV: test - run: | - gem install bundler - bundle config path vendor/bundle - bundle install --jobs 4 --retry 4 - yarn install - sudo apt-get update - sudo apt-get install -y libvips - wget -O pdfium-linux.tgz "https://github.com/docusealco/pdfium-binaries/releases/latest/download/pdfium-linux-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tgz" - sudo tar -xzf pdfium-linux.tgz --strip-components=1 -C /usr/lib lib/libpdfium.so - rm -f pdfium-linux.tgz - - name: Run - env: - RAILS_ENV: test - NODE_ENV: test - COVERAGE: true - DATABASE_URL: postgres://postgres:postgres@localhost:5432/docuseal_test - run: | - bundle exec rake db:create - bundle exec rake db:migrate - bundle exec rake assets:precompile - bundle exec rspec + - name: Deploy + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.SERVER_IP }} + username: ${{ secrets.SERVER_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + port: ${{ secrets.SERVER_SSH_PORT }} + script: | + cd ${{ secrets.PROD_PATH }} + git stash && git pull + docker compose down + docker compose up -d --build From 22e9934ba14fe6c6c1adb996af262eb913c74fd4 Mon Sep 17 00:00:00 2001 From: Arvind verma <7758732+techiarvind@users.noreply.github.com> Date: Tue, 27 Jan 2026 18:55:41 +0530 Subject: [PATCH 3/5] Update ci.yml --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 873e3f09..e55fecfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,5 @@ jobs: port: ${{ secrets.SERVER_SSH_PORT }} script: | cd ${{ secrets.PROD_PATH }} - git stash && git pull docker compose down docker compose up -d --build From 96c72fe7a9c4089ebd0b887abefab2506a0f2c49 Mon Sep 17 00:00:00 2001 From: Arvind verma <7758732+techiarvind@users.noreply.github.com> Date: Tue, 27 Jan 2026 19:02:47 +0530 Subject: [PATCH 4/5] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e55fecfb..f441948d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,5 +22,5 @@ jobs: port: ${{ secrets.SERVER_SSH_PORT }} script: | cd ${{ secrets.PROD_PATH }} - docker compose down - docker compose up -d --build + sudo docker compose down + sudo docker compose up -d --build From 33a82c04771cbe11a27b4c42df25f193e5e086e9 Mon Sep 17 00:00:00 2001 From: Arvind verma <7758732+techiarvind@users.noreply.github.com> Date: Tue, 27 Jan 2026 19:10:13 +0530 Subject: [PATCH 5/5] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f441948d..e55fecfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,5 +22,5 @@ jobs: port: ${{ secrets.SERVER_SSH_PORT }} script: | cd ${{ secrets.PROD_PATH }} - sudo docker compose down - sudo docker compose up -d --build + docker compose down + docker compose up -d --build