diff --git a/.gitea/workflows/build-image.yml b/.gitea/workflows/build-image.yml index aa6eff0..420d305 100644 --- a/.gitea/workflows/build-image.yml +++ b/.gitea/workflows/build-image.yml @@ -1,9 +1,29 @@ name: Build Docker Image run-name: Build Docker Image on: [push] -jobs: - Preparing Dependecies: - steps: - - run: | - ls +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 -y + - name: Install project dependencies + run: | + cd accounting-ng-nuttakit + npm install --force --legacy-peer-deps --include=dev + npm install -g @angular/cli + - name: Build webapp + run: | + cd accounting-ng-nuttakit + ng build + - name: Build docker image + run: | + docker build . -t accounting-frontend:latest + docker image ls + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..501b341 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM nginx:alpine + +ADD accounting-ng-nuttakit/dist/accounting-ng-nuttakit/browser /usr/share/nginx/html