Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/time-tracker-ui-cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
ARM_CLIENT_SECRET: ${{secrets.TF_ARM_CLIENT_SECRET}}
ARM_SUBSCRIPTION_ID: ${{secrets.TF_ARM_SUBSCRIPTION_ID}}
ARM_TENANT_ID: ${{secrets.TF_ARM_TENANT_ID}}

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -30,8 +30,16 @@ jobs:
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Unlock PROD secrets
uses: sliteteam/[email protected]
env:
GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY_PROD }}

- name: Build the docker image
run: make build_prod
run: |-
docker build \
--target production -t timetracker_ui -f Dockerfile_prod \
.

- name: Publish docker image to prod azure container registry
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/time-tracker-ui-cd-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Build the docker image
run: |-
docker build \
--target production -t timetracker_ui \
--target production -t timetracker_ui -f Dockerfile_stage \
.

- name: Publish docker image to stage azure container registry
Expand All @@ -61,4 +61,4 @@ jobs:

- name: Terraform Apply
working-directory: ${{ env.WORKING_DIR }}
run: terraform apply -lock=false -var-file="${{ env.TF_WORKSPACE }}.tfvars" -var "image_tag=$RELEASE_VERSION" -auto-approve
run: terraform apply -var-file="${{ env.TF_WORKSPACE }}.tfvars" -var "image_tag=$RELEASE_VERSION" -auto-approve
3 changes: 1 addition & 2 deletions .github/workflows/time-tracker-ui-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ jobs:

- name: Terraform Plan Prod
id: plan-prod
# run: terraform plan -var-file=${{ env.TF_WORKSPACE }}.tfvars -var image_tag=latest -no-color
run: echo "Disabled for now up to restructure infra tiers"
run: terraform plan -var-file=${{ env.TF_WORKSPACE }}.tfvars -var image_tag=latest -no-color
continue-on-error: true
working-directory: ./${{ env.WORKING_DIR }}
env:
Expand Down
28 changes: 0 additions & 28 deletions Dockerfile

This file was deleted.

13 changes: 13 additions & 0 deletions Dockerfile_prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:14-alpine AS building
WORKDIR /app
COPY . /app
RUN npm cache clean --force && npm install
EXPOSE 4200 9876
RUN source .prod.env && npm run build


FROM nginx:1.21 AS production
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=building /app/dist/time-tracker /usr/share/nginx/html
EXPOSE 80

13 changes: 13 additions & 0 deletions Dockerfile_stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:14-alpine AS building
WORKDIR /app
COPY . /app
RUN npm cache clean --force && npm install
EXPOSE 4200 9876
RUN source .stage.env && npm run build


FROM nginx:1.21 AS production
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=building /app/dist/time-tracker /usr/share/nginx/html
EXPOSE 80

2 changes: 1 addition & 1 deletion infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ locals {

module "ui" {
#source = "../../infra-terraform-modules/azure-app-service"
source = "[email protected]:ioet/infra-terraform-modules.git//azure-app-service?ref=tags/v0.0.13"
source = "[email protected]:ioet/infra-terraform-modules.git//azure-app-service?ref=tags/v0.0.20"
app_service_name = "${local.service_name}-ui"
create_app_service_plan = local.create_app_service_plan
docker_image_name = "${local.image_name}:${var.image_tag}"
Expand Down