mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: deploy
This commit is contained in:
parent
9595011f4e
commit
80255f98de
75
.github/workflows/deploy_test_web.yaml
vendored
75
.github/workflows/deploy_test_web.yaml
vendored
@ -1,75 +0,0 @@
|
|||||||
name: Deploy Web (Test)
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- build/old-test
|
|
||||||
env:
|
|
||||||
NODE_VERSION: "18.16.0"
|
|
||||||
PNPM_VERSION: "8.5.0"
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.WEB_TEST_SSH_PRIVATE_KEY }}
|
|
||||||
REMOTE_HOST: ${{ secrets.WEB_TEST_REMOTE_HOST }}
|
|
||||||
REMOTE_USER: ${{ secrets.WEB_TEST_REMOTE_USER }}
|
|
||||||
SSL_CERTIFICATE: ${{ secrets.WEB_TEST_SSL_CERTIFICATE }}
|
|
||||||
SSL_CERTIFICATE_KEY: ${{ secrets.WEB_TEST_SSL_CERTIFICATE_KEY }}
|
|
||||||
ENV_FILE: test.env
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: setup node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
|
||||||
- name: setup pnpm
|
|
||||||
uses: pnpm/action-setup@v2
|
|
||||||
with:
|
|
||||||
version: ${{ env.PNPM_VERSION }}
|
|
||||||
- name: Node_modules cache
|
|
||||||
uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: frontend/appflowy_web_app/node_modules
|
|
||||||
key: node-modules-${{ runner.os }}
|
|
||||||
- name: install frontend dependencies
|
|
||||||
working-directory: frontend/appflowy_web_app
|
|
||||||
run: |
|
|
||||||
pnpm install
|
|
||||||
- name: copy env file
|
|
||||||
working-directory: frontend/appflowy_web_app
|
|
||||||
run: |
|
|
||||||
cp ${{ env.ENV_FILE }} .env
|
|
||||||
- name: test and lint
|
|
||||||
working-directory: frontend/appflowy_web_app
|
|
||||||
run: |
|
|
||||||
pnpm run lint
|
|
||||||
- name: build
|
|
||||||
working-directory: frontend/appflowy_web_app
|
|
||||||
run: |
|
|
||||||
pnpm run build
|
|
||||||
- name: generate SSL certificate
|
|
||||||
run: |
|
|
||||||
echo "${{ env.SSL_CERTIFICATE }}" > nginx-signed.crt
|
|
||||||
echo "${{ env.SSL_CERTIFICATE_KEY }}" > nginx-signed.key
|
|
||||||
- name: Deploy to EC2
|
|
||||||
uses: easingthemes/ssh-deploy@main
|
|
||||||
with:
|
|
||||||
SSH_PRIVATE_KEY: ${{ env.SSH_PRIVATE_KEY }}
|
|
||||||
ARGS: "-rlgoDzvc -i"
|
|
||||||
SOURCE: "frontend/appflowy_web_app/dist frontend/appflowy_web_app/server.cjs frontend/appflowy_web_app/start.sh frontend/appflowy_web_app/Dockerfile frontend/appflowy_web_app/nginx.conf frontend/appflowy_web_app/.env nginx-signed.crt nginx-signed.key"
|
|
||||||
REMOTE_HOST: ${{ env.REMOTE_HOST }}
|
|
||||||
REMOTE_USER: ${{ env.REMOTE_USER }}
|
|
||||||
TARGET: /home/${{ env.REMOTE_USER }}/appflowy-web-app
|
|
||||||
EXCLUDE: "frontend/appflowy_web_app/dist/, frontend/appflowy_web_app/node_modules/"
|
|
||||||
SCRIPT_AFTER: |
|
|
||||||
cd appflowy-web-app
|
|
||||||
docker system prune -f
|
|
||||||
docker build -t appflowy-web-app .
|
|
||||||
docker rm -f appflowy-web-app || true
|
|
||||||
docker run -d -p 30012:80 --env-file .env --name appflowy-web-app appflowy-web-app
|
|
@ -3,12 +3,14 @@ FROM oven/bun:latest
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y nginx
|
apt-get install -y nginx supervisor
|
||||||
|
|
||||||
RUN bun install cheerio pino pino-pretty
|
RUN bun install cheerio pino pino-pretty
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
COPY supervisord.conf /app/supervisord.conf
|
||||||
|
|
||||||
RUN addgroup --system nginx && \
|
RUN addgroup --system nginx && \
|
||||||
adduser --system --no-create-home --disabled-login --ingroup nginx nginx
|
adduser --system --no-create-home --disabled-login --ingroup nginx nginx
|
||||||
|
|
||||||
@ -22,8 +24,9 @@ COPY nginx.conf /etc/nginx/nginx.conf
|
|||||||
COPY start.sh /app/start.sh
|
COPY start.sh /app/start.sh
|
||||||
|
|
||||||
RUN chmod +x /app/start.sh
|
RUN chmod +x /app/start.sh
|
||||||
|
RUN chmod +x /app/supervisord.conf
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD ["/app/start.sh"]
|
CMD ["supervisord", "-c", "/app/supervisord.conf"]
|
9
frontend/appflowy_web_app/supervisord.conf
Normal file
9
frontend/appflowy_web_app/supervisord.conf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
|
||||||
|
[program:start]
|
||||||
|
command=sh /app/start.sh
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
stderr_logfile=/var/log/start.err.log
|
||||||
|
stdout_logfile=/var/log/start.out.log
|
Loading…
x
Reference in New Issue
Block a user