workflow: initial testing
Some checks failed
Build Docker Image / Build Docker Image (push) Failing after 2m49s

Signed-off-by: supphakitd <67319010028@technictrang.ac.th>
This commit is contained in:
2025-11-21 10:24:38 +07:00
parent 0d26b67165
commit e296f41198
4 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
name: Build Docker Image
run-name: Build Docker Image
on: [push]
jobs:
Build Docker Image:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install system dependencies
run: |
# change mirror to kku.ac.th for faster package downloading
sudo sed -i 's@http://archive.ubuntu.com@http://mirror.kku.ac.th@g' /etc/apt/sources.list.d/ubuntu.sources
sudo apt update && sudo apt install nodejs npm curl -y
- name: Install project dependencies
run: |
npm install
- name: Testing APIs
run: |
./test.sh
- name: Build docker image
run: |
docker build . -t accounting-api:latest

16
Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM alpine:latest
ADD entrypoint /entrypoint
RUN apk update && apk add npm
RUN chmod +x ./entrypoint
RUN mkdir server
ADD node_modules /server
ADD package-lock.json /server
ADD package.json /server
ADD exthernal-login-api /server
ADD exthernal-ttc-api /server
ENTRYPOINT ["/entrypoint"]

3
entrypoint Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
cd server/exthernal-login-api && exec npm run dev

1
test.sh Normal file
View File

@@ -0,0 +1 @@
#!/bin/bash