Skip to content

Commit b799297

Browse files
committed
Building and testing image with github actions
1 parent 90853a3 commit b799297

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/image-ci.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: image-ci
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- v*
9+
10+
jobs:
11+
build-push-tags:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
- name: Docker meta
17+
id: meta
18+
uses: docker/metadata-action@v4
19+
with:
20+
images: harxhitttt/image-ci
21+
tags: |
22+
type=ref,name=short
23+
type=ref,event=tag
24+
- name: Log in to Docker Hub
25+
uses: docker/login-action@v2
26+
with:
27+
username: ${{ secrets.DOCKER_USERNAME }}
28+
password: ${{ secrets.DOCKER_PASSWORD }}
29+
- name: Build and push image
30+
uses: docker/build-push-action@v5
31+
with:
32+
context: ../development-workflow/api-node
33+
file: ./Dockerfile.2
34+
push: true
35+
tags: ${{ steps.meta.outputs.tags }}
36+
- name: Run test on image
37+
run: |
38+
docker run --rm harxhitttt/image-ci:latest node -v

0 commit comments

Comments
 (0)