Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
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
Next Next commit
intial commit
  • Loading branch information
mmaquina committed Mar 7, 2023
commit 47886f43a6de0f69b87d777a579c48e7a525b416
57 changes: 57 additions & 0 deletions .github/workflows/aws-ui-cd-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: time-tracker-ui-cd-stage

on:
push:
branches:
- 'fix-workflow'

jobs:
cd:
runs-on: ubuntu-latest
env:
TF_WORKSPACE: stage
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get the release_version
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo $RELEASE_VERSION


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

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

- name: Publish docker image to stage azure container registry
run: |
make login publish image_tag=$RELEASE_VERSION

# - name: Setup terraform
# uses: hashicorp/setup-terraform@v1
# with:
# terraform_version: 1.1.9

# - name: Authenticate with the TF modules repository
# uses: webfactory/[email protected]
# with:
# ssh-private-key: ${{ secrets.INFRA_TERRAFORM_MODULES_SSH_PRIV_KEY }}

# - name: Terraform Init
# working-directory: ${{ env.WORKING_DIR }}
# run: terraform init

# - name: Terraform Apply
# working-directory: ${{ env.WORKING_DIR }}
# run: terraform apply -var-file="${{ env.TF_WORKSPACE }}.tfvars" -var "image_tag=$RELEASE_VERSION" -auto-approve
Binary file modified .stage.env
Binary file not shown.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ remove_prod: ## Delete container timetracker_ui_prod.

.PHONY: publish_prod
publish_prod: ## Upload a docker image to the prod azure container registry acr=<name_of_the_azure_container_registry> image_tag=<tag_for_the_image>
docker tag timetracker_ui_prod:latest $(acr).azurecr.io/timetracker_ui:$(image_tag)
docker push $(acr).azurecr.io/timetracker_ui:$(image_tag)
docker tag timetracker_ui_prod:latest 568748651446.dkr.ecr.us-east-1.amazonaws.com/time-tracker/stage-ui:$(image_tag)
docker push 568748651446.dkr.ecr.us-east-1.amazonaws.com/time-tracker/stage-ui:$(image_tag)

.PHONY: login
login: ## Login in respository of docker images
Expand Down