Skip to content

Commit ed9e235

Browse files
committed
ci:(workflow) add docker build push action
1 parent d430a80 commit ed9e235

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ jobs:
99
build:
1010
name: 'Build and Push'
1111
runs-on: 'ubuntu-latest'
12-
strategy:
13-
matrix:
14-
node: [16, 18, 20]
12+
# strategy:
13+
# matrix:
14+
# node: [16, 18, 20]
1515

1616
steps:
1717
- uses: actions/checkout@v4
1818

19-
- name: Setup node | ${{ matrix.node }}
19+
# - name: Setup node | ${{ matrix.node }}
20+
- name: Setup node
2021
uses: actions/setup-node@v4
2122
with:
22-
node-version: ${{ matrix.node }}
23+
# node-version: ${{ matrix.node }}
24+
node-version: '18'
2325
cache: 'npm'
2426
- run: npm install
2527
- run: npm run test
@@ -36,8 +38,14 @@ jobs:
3638
username: ${{ secrets.DOCKERHUB_USERNAME }}
3739
password: ${{ secrets.DOCKERHUB_TOKEN }}
3840

39-
- name: Build docker image
40-
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/masa-api:${{ steps.generate_tag.outputs.sha }} .
41+
- name: Build and push
42+
uses: docker/build-push-action@v6
43+
with:
44+
push: true
45+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/masa-api:${{ steps.generate_tag.outputs.sha }},${{ secrets.DOCKERHUB_USERNAME }}/masa-api:latest
46+
47+
# - name: Build docker image
48+
# run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/masa-api:${{ steps.generate_tag.outputs.sha }} .
4149

42-
- name: Push image
43-
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/masa-api:${{ steps.generate_tag.outputs.sha }}
50+
# - name: Push image
51+
# run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/masa-api:${{ steps.generate_tag.outputs.sha }}

0 commit comments

Comments
 (0)