Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c68446bf25 | ||
|
|
63519429e6 | ||
|
|
5282ca3c4a | ||
|
|
f5e4b10d1b | ||
|
|
efebc79d35 | ||
|
|
ad324a9a97 | ||
|
|
4145cacf1a |
@@ -10,8 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
DOCKER_ORG: heronfief
|
||||
REPO_NAME: front
|
||||
REPO_NAME: ${{ gitea.repository }}
|
||||
ENDPOINT: git.legonzaur.fr
|
||||
|
||||
steps:
|
||||
@@ -21,12 +20,6 @@ jobs:
|
||||
lfs: false
|
||||
persist-credentials: false
|
||||
|
||||
- name: Get Meta
|
||||
id: meta
|
||||
run: |
|
||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
||||
|
||||
- name: setup private key
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -38,7 +31,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
ssh-keyscan ${{ env.ENDPOINT }} >> ~/.ssh/known_hosts
|
||||
git remote set-url origin git@${{ env.ENDPOINT }}:${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}.git
|
||||
git remote set-url origin git@${{ env.ENDPOINT }}:${{ env.REPO_NAME }}.git
|
||||
git lfs pull
|
||||
|
||||
- name: Login to DockerHub
|
||||
@@ -52,7 +45,7 @@ jobs:
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.ENDPOINT }}/${{ env.DOCKER_ORG }}/${{ env.REPO_NAME }}
|
||||
images: ${{ env.ENDPOINT }}/${{ env.REPO_NAME }}
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
@@ -66,8 +59,10 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
secrets: |
|
||||
"NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT=${{ secrets.NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT }}"
|
||||
build-args: |
|
||||
NUXT_PUBLIC_ENDPOINT=${{ vars.NUXT_PUBLIC_ENDPOINT }}
|
||||
NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT=${{ vars.NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT }}
|
||||
NUXT_PUBLIC_WELCOME_MESSAGE=${{ vars.NUXT_PUBLIC_WELCOME_MESSAGE }}
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
+7
-7
@@ -1,15 +1,15 @@
|
||||
FROM node:lts-alpine as build-stage
|
||||
FROM node:lts-alpine AS build-stage
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN --mount=type=secret,id=NUXT_PUBLIC_WEBSOCKET_ENDPOINT \
|
||||
--mount=type=secret,id=NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT \
|
||||
NUXT_PUBLIC_WEBSOCKET_ENDPOINT=$(cat /run/secrets/NUXT_PUBLIC_WEBSOCKET_ENDPOINT ) \
|
||||
NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT=$(cat /run/secrets/NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT ) \
|
||||
npx nuxi generate
|
||||
ARG NUXT_PUBLIC_ENDPOINT
|
||||
ARG NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT
|
||||
ARG NUXT_PUBLIC_WELCOME_MESSAGE
|
||||
|
||||
RUN npx nuxi generate
|
||||
|
||||
# étape de production
|
||||
FROM nginx:stable-alpine as production-stage
|
||||
FROM nginx:stable-alpine AS production-stage
|
||||
COPY --from=build-stage /app/.output/public /usr/share/nginx/html
|
||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||
+2
-2
@@ -4,8 +4,8 @@ export default defineNuxtConfig({
|
||||
ssr: true,
|
||||
runtimeConfig: {
|
||||
public: {
|
||||
endpoint:
|
||||
process.env.NUXT_PUBLIC_ENDPOINT || "https://playtest.legonzaur.fr/api", // can be overridden by NUXT_PUBLIC_ENDPOINT environment variable
|
||||
welcomeMessage: "Hello",
|
||||
endpoint: "https://playtest.legonzaur.fr/api", // can be overridden by NUXT_PUBLIC_ENDPOINT environment variable
|
||||
discordLoginEndpoint: process.env.NUXT_PUBLIC_DISCORD_LOGIN_ENDPOINT,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
const config = useRuntimeConfig();
|
||||
config.public.welcomeMessage;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
{{ config.public.welcomeMessage }}
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user