Podpora sestavování přes Woodpecker CI
All checks were successful
ci/woodpecker/push/workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/workflow Pipeline was successful
This commit is contained in:
parent
469a6b9031
commit
9e247eb2a1
56
.woodpecker/workflow.yaml
Normal file
56
.woodpecker/workflow.yaml
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
variables:
|
||||||
|
- &node_image 'node:18-alpine3.18'
|
||||||
|
- &branch 'master'
|
||||||
|
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: *branch
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install server dependencies
|
||||||
|
image: *node_image
|
||||||
|
commands:
|
||||||
|
- cd server
|
||||||
|
- yarn install --frozen-lockfile
|
||||||
|
- name: Install client dependencies
|
||||||
|
image: *node_image
|
||||||
|
commands:
|
||||||
|
- cd client
|
||||||
|
- yarn install --frozen-lockfile
|
||||||
|
- name: Build server
|
||||||
|
depends_on: [Install server dependencies]
|
||||||
|
image: *node_image
|
||||||
|
commands:
|
||||||
|
- cd server
|
||||||
|
- yarn build
|
||||||
|
- name: Build client
|
||||||
|
depends_on: [Install client dependencies]
|
||||||
|
image: *node_image
|
||||||
|
commands:
|
||||||
|
- cd client
|
||||||
|
- yarn build
|
||||||
|
- name: Build Docker image
|
||||||
|
depends_on: [Build server, Build client]
|
||||||
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
settings:
|
||||||
|
dockerfile: Dockerfile-Woodpecker
|
||||||
|
platforms: linux/amd64
|
||||||
|
registry:
|
||||||
|
from_secret: REPO_URL
|
||||||
|
username:
|
||||||
|
from_secret: REPO_USERNAME
|
||||||
|
password:
|
||||||
|
from_secret: REPO_PASSWORD
|
||||||
|
repo:
|
||||||
|
from_secret: REPO_NAME
|
||||||
|
- name: Discord notification - build
|
||||||
|
image: appleboy/drone-discord
|
||||||
|
depends_on: [Build Docker image]
|
||||||
|
when:
|
||||||
|
- status: [success, failure]
|
||||||
|
settings:
|
||||||
|
webhook_id:
|
||||||
|
from_secret: DISCORD_WEBHOOK_ID
|
||||||
|
webhook_token:
|
||||||
|
from_secret: DISCORD_WEBHOOK_TOKEN
|
||||||
|
message: "{{#success build.status}}✅ Sestavení {{build.number}} proběhlo úspěšně.{{else}}❌ Sestavení {{build.number}} selhalo.{{/success}}\n\nPipeline: {{build.link}}\nPoslední commit: {{commit.message}}Autor: {{commit.author}}"
|
21
Dockerfile-Woodpecker
Normal file
21
Dockerfile-Woodpecker
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
FROM node:18-alpine3.18
|
||||||
|
ENV LANG=cs_CZ.UTF-8
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Vykopírování sestaveného serveru
|
||||||
|
COPY ./server/node_modules ./server/node_modules
|
||||||
|
COPY ./server/dist ./
|
||||||
|
# TODO tohle není dobře, má to být součástí serveru
|
||||||
|
# COPY ./server/resources ./resources
|
||||||
|
|
||||||
|
# Vykopírování sestaveného klienta
|
||||||
|
COPY ./client/dist ./public
|
||||||
|
|
||||||
|
# Zkopírování konfigurace easter eggů
|
||||||
|
RUN if [ -f ./server/.easter-eggs.json ]; then cp ./server/.easter-eggs.json ./server/; fi
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD [ "node", "./server/src/index.js" ]
|
Loading…
x
Reference in New Issue
Block a user