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..693f607 100644 --- a/.github/workflows/build-ghcr-image.yaml +++ b/.github/workflows/build-ghcr-image.yaml @@ -4,6 +4,12 @@ name: 'Build Image for GitHub Container Registry' on: workflow_call: + inputs: + environment: + description: 'The environment to deploy to ("production", "development")' + required: true + type: string + default: 'production' jobs: build_docker_image: @@ -13,6 +19,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 id: meta uses: docker/metadata-action@v4 diff --git a/.github/workflows/deploy-dev.yaml b/.github/workflows/deploy-dev.yaml index 304d71a..ed5c828 100644 --- a/.github/workflows/deploy-dev.yaml +++ b/.github/workflows/deploy-dev.yaml @@ -19,7 +19,7 @@ jobs: name: Build Image for Development uses: ./.github/workflows/build-gcp-image.yaml with: - environment: development + environment: 'development' secrets: inherit @@ -32,7 +32,7 @@ jobs: uses: ./.github/workflows/cloud-run-deploy.yaml needs: build_gcp_image with: - environment: development + environment: 'development' version: ${{ needs.build_gcp_image.outputs.version }} - service: client-dev + service: 'client-dev' secrets: inherit diff --git a/.github/workflows/deploy-prod.yaml b/.github/workflows/deploy-prod.yaml index 3d2c7a8..5248d85 100644 --- a/.github/workflows/deploy-prod.yaml +++ b/.github/workflows/deploy-prod.yaml @@ -16,7 +16,7 @@ jobs: contents: read uses: ./.github/workflows/build-gcp-image.yaml with: - environment: production + environment: 'production' secrets: inherit deploy_to_cloud_run: @@ -28,12 +28,14 @@ jobs: uses: ./.github/workflows/cloud-run-deploy.yaml needs: build_gcp_image with: - environment: production + environment: 'production' version: ${{ needs.build_gcp_image.outputs.version }} - service: client + service: 'client' secrets: inherit build_ghcr_image: name: Build Image for GHCR uses: ./.github/workflows/build-ghcr-image.yaml - secrets: inherit \ No newline at end of file + secrets: inherit + with: + environment: 'production' \ No newline at end of file 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 (