create docker image ci/cd
All checks were successful
Build and Deploy Client / build-and-deploy (push) Successful in 29s
All checks were successful
Build and Deploy Client / build-and-deploy (push) Successful in 29s
This commit is contained in:
@@ -1,2 +1,42 @@
|
||||
|
||||
name: "Build and Deploy Client"
|
||||
name: Build and Deploy Client
|
||||
|
||||
run-name: "${{ gitea.event.head_commit.message }}: Deploy Client"
|
||||
|
||||
on:
|
||||
push:
|
||||
#branches:
|
||||
# - main
|
||||
paths:
|
||||
- "client/**"
|
||||
- ".gitea/workflows/deploy-client.yaml"
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: debian12
|
||||
container:
|
||||
image: git.vxbard.net/homeburger/bard-cpp-builder:1.0
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# needs this in order to push to the registry
|
||||
- name: Validate Registry
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.vxbard.net \
|
||||
-u ${{ secrets.REGISTRY_USERNAME }} \
|
||||
--password-stdin
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
docker build -t git.vxbard.net/homeburger/phish-client:latest ./client
|
||||
|
||||
- name: Push
|
||||
run: |
|
||||
docker push git.vxbard.net/homeburger/phish-client:latest
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
docker compose -f ./client/docker-compose.prod.yaml pull phish-client
|
||||
docker compose -f ./client/docker-compose.prod.yaml up -d --force-recreate phish-client
|
||||
|
||||
16
client/Dockerfile
Normal file
16
client/Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
# build angular app
|
||||
FROM node:current-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
|
||||
# serve app
|
||||
EXPOSE 80
|
||||
CMD ["npm", "run", "start", "--", "--host", "0.0.0.0", "--poll", "2000"]
|
||||
|
||||
# docker build -t phish-client:latest .
|
||||
# docker tag phish-client:latest git.vxbard.net/homeburger/phish-client:1.0
|
||||
# docker push git.vxbard.net/homeburger/phish-client:1.0
|
||||
8
client/docker-compose.prod.yaml
Normal file
8
client/docker-compose.prod.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
services:
|
||||
phish-client:
|
||||
image: git.vxbard.net/homeburger/phish-client:latest
|
||||
container_name: phish-client
|
||||
restart: always
|
||||
ports:
|
||||
- "9000:80"
|
||||
Reference in New Issue
Block a user