Skip to content

Commit

Permalink
fix(ci/cd): Expose on server port
Browse files Browse the repository at this point in the history
  • Loading branch information
annelhote committed May 16, 2024
1 parent a1e31a5 commit 6c9a34f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ jobs:

- name: 🪚 Build app
run: |
npm install
npm ci --silent
npm run build
- name: 🔑 Login Docker
run: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}

- name: 🐳 Build Docker image
run: |
IMAGE_ID=ghcr.io/dataesr/ticket-office
IMAGE_ID=ghcr.io/${{ github.repository }}
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker build -t $IMAGE_ID:staging . --build-arg VITE_SCANR_API_AUTHORIZATION=${{ secrets.VITE_SCANR_API_AUTHORIZATION }}
docker build -t $IMAGE_ID:staging .
- name: 📦 Push Docker image
run: |
IMAGE_ID=ghcr.io/dataesr/ticket-office
IMAGE_ID=ghcr.io/${{ github.repository }}
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker push $IMAGE_ID:staging
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
FROM nginx:stable
ARG VITE_SCANR_API_AUTHORIZATION
ENV VITE_SCANR_API_AUTHORIZATION=$VITE_SCANR_API_AUTHORIZATION
COPY dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/templates/nginx.conf.template
EXPOSE 5173
EXPOSE 3000
3 changes: 1 addition & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";

export default defineConfig({
base: "/",
plugins: [react()],
});

0 comments on commit 6c9a34f

Please sign in to comment.