Skip to content

Commit 7bd7449

Browse files
committed
feat: Add buildpacks for building docker image
1 parent 62481ab commit 7bd7449

File tree

5 files changed

+30
-188
lines changed

5 files changed

+30
-188
lines changed

.github/workflows/docker.yml

-113
This file was deleted.

.github/workflows/release.yml

+19-15
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,30 @@ on:
55
branches:
66
- master
77

8+
env:
9+
DOCKER_IMAGE_NAME: mergeability/mergeable
10+
811
jobs:
912
build:
1013
name: Release
1114
runs-on: ubuntu-latest
12-
13-
strategy:
14-
matrix:
15-
node-version: [20.11.1]
16-
1715
steps:
18-
- uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
21-
- name: Use Node.js ${{ matrix.node-version }}
22-
uses: actions/setup-node@v4
23-
with:
24-
node-version: ${{ matrix.node-version }}
25-
- run: npm install
26-
- name: Release
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Semantic Release
19+
id: semantic
20+
uses: cycjimmy/semantic-release-action@v4
2721
env:
2822
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2923
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
30-
run: npx semantic-release
24+
- name: Login to Docker Hub
25+
uses: docker/login-action@v3
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
password: ${{ secrets.DOCKERHUB_TOKEN }}
29+
if: ${{ steps.semantic.outputs.new_release_version }}
30+
- uses: buildpacks/github-actions/[email protected]
31+
if: ${{ steps.semantic.outputs.new_release_version }}
32+
- name: Build and publish docker image
33+
if: ${{ steps.semantic.outputs.new_release_version }}
34+
run: pack build ${{ env.DOCKER_IMAGE_NAME }} -t ${{ env.DOCKER_IMAGE_NAME }}:${{ steps.semantic.outputs.new_release_version }} -t ${{ env.DOCKER_IMAGE_NAME }}:latest -B paketobuildpacks/builder-jammy-tiny -b docker.io/paketobuildpacks/nodejs --publish

.github/workflows/testing.yml

+5-20
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,16 @@
11
name: CI
22

3-
on:
4-
push:
5-
branches: ['**']
6-
pull_request:
7-
branches: ['**']
8-
9-
permissions:
10-
contents: read
3+
on: [ push ]
114

125
jobs:
136
build:
14-
name: Tests and Code Coverage
157
runs-on: ubuntu-latest
16-
17-
strategy:
18-
matrix:
19-
node-version: [20.11.1]
20-
218
steps:
229
- uses: actions/checkout@v4
23-
- name: Use Node.js ${{ matrix.node-version }}
10+
- name: Use Node.js
2411
uses: actions/setup-node@v4
2512
with:
26-
node-version: ${{ matrix.node-version }}
27-
- run: npm install
13+
node-version: '20.x'
14+
- run: npm ci
2815
- run: npm run build --if-present
29-
- run: npm run test-coverage
30-
env:
31-
CI: true
16+
- run: npm test

Dockerfile

-38
This file was deleted.

package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"standard": "^16.0.3"
4444
},
4545
"engines": {
46-
"node": ">= 18.12.1"
46+
"node": "^20"
4747
},
4848
"standard": {
4949
"env": [
@@ -58,5 +58,9 @@
5858
"collectCoverageFrom": [
5959
"lib/**/*.js"
6060
]
61-
}
61+
},
62+
"publishConfig": {
63+
"access": "public"
64+
},
65+
"private": false
6266
}

0 commit comments

Comments
 (0)