From 61222028a2191d2eb6050684e0affad37cec8435 Mon Sep 17 00:00:00 2001 From: Marcos Sader Date: Mon, 2 Mar 2026 23:04:11 -0300 Subject: [PATCH 1/2] fix(ci): isolate semantic-release and use docker only for app tasks --- .github/workflows/deploy.yml | 27 +++++++++++++++++++++++---- .github/workflows/test.yml | 2 +- Dockerfile | 3 --- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b9d806c..5cf204b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,14 +15,33 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v6 + uses: actions/checkout@v4 with: fetch-depth: 0 - - name: build and deploy + - name: get node version + run: echo "NODE_VERSION=$(node -p "JSON.parse(fs.readFileSync('./.versions','utf8')).node")" >> $GITHUB_OUTPUT + id: node_version + + - name: setup node + uses: actions/setup-node@v4 + with: + node-version: ${{ steps.node_version.outputs.NODE_VERSION }} + cache: 'npm' + + - name: install dependencies + env: + HUSKY: 0 + run: npm install + + - name: run semantic-release + run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: deploy to cloudflare workers run: | docker compose run --rm \ - -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \ -e CLOUDFLARE_API_TOKEN=${{ secrets.CF_API_TOKEN }} \ app \ - bash -c "npx semantic-release && npx wrangler deploy" + npx wrangler deploy diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f510690..2fd066a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v6 + uses: actions/checkout@v4 - name: build and test run: docker compose run --rm app npm test diff --git a/Dockerfile b/Dockerfile index deced70..4ee3bab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,6 @@ # Use Node.js 20 as the base image for stability and compatibility FROM node:20-slim -# Install git for semantic-release and other tools -RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* - # Set the working directory inside the container WORKDIR /app From 7c991e18f71c3c4e3a30929c624739dc2c28e6cc Mon Sep 17 00:00:00 2001 From: Marcos Sader Date: Mon, 2 Mar 2026 23:06:56 -0300 Subject: [PATCH 2/2] chore(ci): upgrade actions/checkout to v6 --- .github/workflows/deploy.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5cf204b..6e01134 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2fd066a..f510690 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: build and test run: docker compose run --rm app npm test