Skip to content

Commit 4e5a1d2

Browse files
authored
Merge pull request #199 from xmarcos/fix/isolated-semantic-release
fix(ci): isolate semantic-release from Docker
2 parents 7d8adf3 + 7c991e1 commit 4e5a1d2

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,29 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22-
- name: build and deploy
22+
- name: get node version
23+
run: echo "NODE_VERSION=$(node -p "JSON.parse(fs.readFileSync('./.versions','utf8')).node")" >> $GITHUB_OUTPUT
24+
id: node_version
25+
26+
- name: setup node
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ steps.node_version.outputs.NODE_VERSION }}
30+
cache: 'npm'
31+
32+
- name: install dependencies
33+
env:
34+
HUSKY: 0
35+
run: npm install
36+
37+
- name: run semantic-release
38+
run: npx semantic-release
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
42+
- name: deploy to cloudflare workers
2343
run: |
2444
docker compose run --rm \
25-
-e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
2645
-e CLOUDFLARE_API_TOKEN=${{ secrets.CF_API_TOKEN }} \
2746
app \
28-
bash -c "npx semantic-release && npx wrangler deploy"
47+
npx wrangler deploy

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Use Node.js 20 as the base image for stability and compatibility
22
FROM node:20-slim
33

4-
# Install git for semantic-release and other tools
5-
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
6-
74
# Set the working directory inside the container
85
WORKDIR /app
96

0 commit comments

Comments
 (0)