publish website when push on main
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/.drone.yml
|
||||||
|
/.nuxt
|
||||||
|
/.output
|
||||||
|
/docker
|
||||||
|
/node_modules
|
||||||
|
/.git*
|
||||||
30
.drone.yml
30
.drone.yml
@@ -7,22 +7,40 @@ steps:
|
|||||||
- name: build
|
- name: build
|
||||||
image: docker:dind
|
image: docker:dind
|
||||||
environment:
|
environment:
|
||||||
COMPOSE_PROJECT_NAME: adv-testing-${DRONE_COMMIT_BRANCH//\//-}
|
COMPOSE_PROJECT_NAME: dav-testing-${DRONE_COMMIT_BRANCH//\//-}
|
||||||
NUXT_APP_BASE_URL: /adv/${DRONE_COMMIT_BRANCH}/
|
NUXT_APP_BASE_URL: /${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/${DRONE_COMMIT_BRANCH}/
|
||||||
SERVICE_3000_CHECK_HTTP: /adv/${DRONE_COMMIT_BRANCH}/
|
SERVICE_3000_CHECK_HTTP: /${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/${DRONE_COMMIT_BRANCH}/
|
||||||
SERVICE_3000_TAGS: urlprefix-testing.asycn.io/adv/${DRONE_COMMIT_BRANCH}/*
|
SERVICE_3000_TAGS: urlprefix-testing.asycn.io/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/${DRONE_COMMIT_BRANCH}/*
|
||||||
commands:
|
commands:
|
||||||
|
- docker build --target static --output /drone/src/.output/public -f docker/Dockerfile .
|
||||||
- docker compose -f docker/docker-compose.yml -f docker/docker-compose.labels.yml up --build -d
|
- docker compose -f docker/docker-compose.yml -f docker/docker-compose.labels.yml up --build -d
|
||||||
|
- ls -la /drone/src/.output/public
|
||||||
volumes:
|
volumes:
|
||||||
- name: dockersock
|
- name: dockersock
|
||||||
path: /var/run/docker.sock
|
path: /var/run/docker.sock
|
||||||
|
|
||||||
|
- name: publish
|
||||||
|
image: appleboy/drone-scp
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: ssh_username
|
||||||
|
password:
|
||||||
|
from_secret: ssh_password
|
||||||
|
host: open.us.org
|
||||||
|
port: 22
|
||||||
|
source: /drone/src/.output/public/*
|
||||||
|
target: /dav/www/
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- main
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
- name: notify
|
- name: notify
|
||||||
image: appleboy/drone-telegram
|
image: appleboy/drone-telegram
|
||||||
when:
|
when:
|
||||||
status:
|
status:
|
||||||
- success
|
- success
|
||||||
- failure
|
|
||||||
settings:
|
settings:
|
||||||
token:
|
token:
|
||||||
from_secret: telegram_token
|
from_secret: telegram_token
|
||||||
@@ -35,7 +53,7 @@ steps:
|
|||||||
```
|
```
|
||||||
{{commit.message}}
|
{{commit.message}}
|
||||||
```
|
```
|
||||||
🌐 https://testing.asycn.io/adv/{{commit.branch}}/
|
🌐 https://testing.asycn.io/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/{{commit.branch}}/
|
||||||
{{else}}
|
{{else}}
|
||||||
❌ Le build #{{build.number}} du repo `{{repo.name}}` est un gros fail...
|
❌ Le build #{{build.number}} du repo `{{repo.name}}` est un gros fail...
|
||||||
📝 Commit de {{commit.email}} sur la branche `{{commit.branch}}`:
|
📝 Commit de {{commit.email}} sur la branche `{{commit.branch}}`:
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ FROM base AS build
|
|||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
COPY --link ./ ./
|
COPY --link ./ ./
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
FROM build AS master
|
FROM build AS master
|
||||||
RUN npm run build
|
RUN npm run generate
|
||||||
|
|
||||||
|
FROM scratch AS static
|
||||||
|
COPY --from=master /app/.output/public .output/public
|
||||||
|
|
||||||
FROM base AS prod
|
FROM base AS prod
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
# COPY --from=build /app/node_modules /app/node_modules
|
|
||||||
COPY --from=master /app/.output /app/.output
|
COPY --from=master /app/.output /app/.output
|
||||||
CMD [ "node", ".output/server/index.mjs" ]
|
CMD [ "node", ".output/server/index.mjs" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user