From 81387fa06ad43e9e962d07db490a609da15ebebb Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Sat, 30 Sep 2023 13:50:46 -0400 Subject: [PATCH] remove staging dockerfile, add configureation steps to workflows --- .github/workflows/build-gcp-image.yaml | 10 ++++++++++ .github/workflows/build-ghcr-image.yaml | 9 +++++++++ Dockerfile.staging | 17 ----------------- .env.production => config/.env.production | 0 .env.staging => config/.env.staging | 0 src/features/Resume/Resume.tsx | 1 - 6 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 Dockerfile.staging rename .env.production => config/.env.production (100%) rename .env.staging => config/.env.staging (100%) diff --git a/.github/workflows/build-gcp-image.yaml b/.github/workflows/build-gcp-image.yaml index 16f3f97..7c80e76 100644 --- a/.github/workflows/build-gcp-image.yaml +++ b/.github/workflows/build-gcp-image.yaml @@ -41,6 +41,16 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Configure Dev image + if: ${{ inputs.environment == 'development' }} + run: | + cp config/.env.staging .env + + - name: Configure Prod image + if: ${{ inputs.environment == 'production' }} + run: | + cp config/.env.production .env + - name: Docker meta uses: docker/metadata-action@v4 id: meta diff --git a/.github/workflows/build-ghcr-image.yaml b/.github/workflows/build-ghcr-image.yaml index fd82e42..b90b62b 100644 --- a/.github/workflows/build-ghcr-image.yaml +++ b/.github/workflows/build-ghcr-image.yaml @@ -13,6 +13,15 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Configure Dev image + run: | + cp config/.env.staging .env + + - name: Configure Prod image + if: ${{ inputs.environment == 'production' }} + run: | + cp config/.env.production .env + - name: Docker meta id: meta uses: docker/metadata-action@v4 diff --git a/Dockerfile.staging b/Dockerfile.staging deleted file mode 100644 index d63ff7c..0000000 --- a/Dockerfile.staging +++ /dev/null @@ -1,17 +0,0 @@ -# Mutlistage dockerize dpgraham.com react.js front end -# Build stage -FROM node:18-alpine as builder -WORKDIR /app -COPY . . -RUN npm ci --silent -RUN npm run build:staging - -# Bundle stage -FROM nginx:1.25.1-alpine as production -ENV NODE_ENV production -COPY --from=builder /app/build /usr/share/nginx/html -# Add nginx.conf -COPY nginx.conf /etc/nginx/conf.d/default.conf -EXPOSE 3000 -# Start nginx -CMD ["nginx", "-g", "daemon off;"] diff --git a/.env.production b/config/.env.production similarity index 100% rename from .env.production rename to config/.env.production diff --git a/.env.staging b/config/.env.staging similarity index 100% rename from .env.staging rename to config/.env.staging diff --git a/src/features/Resume/Resume.tsx b/src/features/Resume/Resume.tsx index 8b230fd..9b0af2d 100644 --- a/src/features/Resume/Resume.tsx +++ b/src/features/Resume/Resume.tsx @@ -18,7 +18,6 @@ const fabStyle = { * @constructor */ export function Resume() { - // ToDo - Add a way to download PDF resume useTitle("Resume"); return (