build image

This commit is contained in:
Dede Fuji Abdul 2024-01-16 12:31:31 +07:00
parent c2a338e426
commit 6ec92d8311
3 changed files with 18 additions and 4 deletions

View File

@ -14,6 +14,20 @@ jobs:
if: contains(github.event.head_commit.message, 'build image')
steps:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install Dependencies
run: npm install
- name: Set Version Tag
run: |
version=$(npm version patch)
echo "Version Tag: $version"
echo "::set-output name=version_tag::$version"
- uses: actions/checkout@v3
- name: Docker Hub Login
env:
@ -23,8 +37,7 @@ jobs:
- name: Build the Docker image
run: |
docker build . -t defuj/apkt-eis
docker image tag defuj/apkt-eis defuj/apkt-eis:dev-$(date +%s)
docker push defuj/apkt-eis:dev-$(date +%s)
docker build . -t defuj/apkt-eis:dev-${{ steps.set_version.outputs.version_tag }}
docker push defuj/apkt-eis:dev-${{ steps.set_version.outputs.version_tag }}

View File

@ -1,4 +1,5 @@
FROM node:lts-alpine as build-stage
ARG VERSION=0.0.1
WORKDIR /app
COPY package*.json ./
RUN npm install

View File

@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: apkt-eis
image: docker.io/defuj/apkt-eis:dev-1705378929
image: docker.io/apkt-eis:dev-0.0.1
ports:
- containerPort: 80
---