File tree Expand file tree Collapse file tree 3 files changed +14
-36
lines changed
Expand file tree Collapse file tree 3 files changed +14
-36
lines changed Original file line number Diff line number Diff line change @@ -18,23 +18,11 @@ jobs:
1818 uses : actions/checkout@v4
1919 with :
2020 fetch-depth : 0
21- - name : get node version
22- run : echo "NODE_VERSION=$(node -p "JSON.parse(fs.readFileSync('./.versions','utf8')).node")" >> $GITHUB_OUTPUT
23- id : node_version
24- - name : setup node
25- uses : actions/setup-node@v4
26- with :
27- node-version : ${{ steps.node_version.outputs.NODE_VERSION }}
28- cache : ' npm'
29- - name : install dependencies
30- env :
31- HUSKY : 0
32- run : npm install
33- - name : run semantic-release
34- run : npx semantic-release
35- env :
36- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
37- - name : deploy to cloudflare workers
38- uses : cloudflare/wrangler-action@v3
39- with :
40- apiToken : ${{ secrets.CF_API_TOKEN }}
21+
22+ - name : build and deploy
23+ run : |
24+ docker compose run --rm \
25+ -e GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
26+ -e CLOUDFLARE_API_TOKEN=${{ secrets.CF_API_TOKEN }} \
27+ app \
28+ bash -c "npx semantic-release && npx wrangler deploy"
Original file line number Diff line number Diff line change 2020 steps :
2121 - name : checkout
2222 uses : actions/checkout@v4
23- with :
24- fetch-depth : 0
25- - name : get node version
26- run : echo "NODE_VERSION=$(node -p "JSON.parse(fs.readFileSync('./.versions','utf8')).node")" >> $GITHUB_OUTPUT
27- id : node_version
28- - name : setup node
29- uses : actions/setup-node@v4
30- with :
31- node-version : ${{ steps.node_version.outputs.NODE_VERSION }}
32- cache : ' npm'
33- - name : install dependencies
34- env :
35- HUSKY : 0
36- run : npm install
37- - name : run tests
38- run : npm test
23+
24+ - name : build and test
25+ run : docker compose run --rm app npm test
Original file line number Diff line number Diff line change 11# Use Node.js 20 as the base image for stability and compatibility
22FROM 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+
47# Set the working directory inside the container
58WORKDIR /app
69
You can’t perform that action at this time.
0 commit comments