workflow: initial testing
Some checks failed
Build Docker Image / Build Docker Image (push) Failing after 2m49s
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:
26
.gitea/workflows/build-image.yml
Normal file
26
.gitea/workflows/build-image.yml
Normal 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
16
Dockerfile
Normal 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
3
entrypoint
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd server/exthernal-login-api && exec npm run dev
|
||||||
Reference in New Issue
Block a user