Skip to content

Commit

Permalink
rename admin to backoffice in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Dec 4, 2024
1 parent 98a78b2 commit c6f7209
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,47 +155,47 @@ jobs:
${{ steps.login-ecr.outputs.registry }}/${{ secrets.API_REPOSITORY_NAME }}:${{ github.sha }}
${{ steps.login-ecr.outputs.registry }}/${{ secrets.API_REPOSITORY_NAME }}:${{ needs.set_environment_name.outputs.env_name }}
build_admin:
build_backoffice:
needs: [ set_environment_name ]
environment:
name: ${{ needs.set_environment_name.outputs.env_name }}
runs-on: ubuntu-latest
name: Build Admin image and push to Amazon ECR
name: Build Backoffice image and push to Amazon ECR
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: dorny/paths-filter@v3
id: admin-changes
id: backoffice-changes
with:
filters: |
admin:
- 'admin/**'
backoffice:
- 'backoffice/**'
- '.github/workflows/**'
shared:
- 'shared/**'
- name: Configure AWS credentials
if: ${{ github.event_name == 'workflow_dispatch' || steps.admin-changes.outputs.admin == 'true' }}
if: ${{ github.event_name == 'workflow_dispatch' || steps.backoffice-changes.outputs.backoffice == 'true' }}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.PIPELINE_USER_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PIPELINE_USER_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
if: ${{ github.event_name == 'workflow_dispatch' || steps.admin-changes.outputs.admin == 'true' }}
if: ${{ github.event_name == 'workflow_dispatch' || steps.backoffice-changes.outputs.backoffice == 'true' }}
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
mask-password: 'true'

- name: Set up Docker Buildx
if: ${{ github.event_name == 'workflow_dispatch' || steps.admin-changes.outputs.admin == 'true' }}
if: ${{ github.event_name == 'workflow_dispatch' || steps.backoffice-changes.outputs.backoffice == 'true' }}
uses: docker/setup-buildx-action@v3

- name: Build, tag, and push Admin image to Amazon ECR
if: ${{ github.event_name == 'workflow_dispatch' || steps.admin-changes.outputs.admin == 'true' }}
if: ${{ github.event_name == 'workflow_dispatch' || steps.backoffice-changes.outputs.backoffice == 'true' }}
uses: docker/build-push-action@v6
with:
build-args: |
Expand All @@ -208,7 +208,7 @@ jobs:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
file: ./admin/Dockerfile
file: ./backoffice/Dockerfile
push: true
tags: |
${{ steps.login-ecr.outputs.registry }}/${{ secrets.ADMIN_REPOSITORY_NAME }}:${{ github.sha }}
Expand All @@ -217,7 +217,7 @@ jobs:
deploy:
name: Deploy Services to Amazon EBS
needs: [ set_environment_name, build_client, build_api, build_admin ]
needs: [ set_environment_name, build_client, build_api, build_backoffice]
runs-on: ubuntu-latest
environment:
name: ${{ needs.set_environment_name.outputs.env_name }}
Expand Down Expand Up @@ -258,7 +258,7 @@ jobs:
restart: always
ports:
- 4000:4000
admin:
backoffice:
image: $ECR_REGISTRY/$ECR_REPOSITORY_ADMIN:$IMAGE_TAG
restart: always
ports:
Expand All @@ -274,7 +274,7 @@ jobs:
depends_on:
- api
- client
- admin
- backoffice
EOF
- name: Generate zip file
Expand Down
11 changes: 9 additions & 2 deletions infrastructure/modules/env/api_env_vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ resource "random_password" "email_confirmation_token_secret" {
special = true
override_special = "!#%&*()-_=+[]{}<>:?"
}
resource "random_password" "backoffice_session_cookie_secret" {
length = 32
special = true
override_special = "!#%&*()-_=+[]{}<>:?"
}

resource "aws_iam_access_key" "email_user_access_key" {
user = module.email.iam_user.name
Expand All @@ -37,8 +42,10 @@ locals {
AWS_SES_ACCESS_KEY_ID = aws_iam_access_key.email_user_access_key.id
AWS_SES_ACCESS_KEY_SECRET = aws_iam_access_key.email_user_access_key.secret
AWS_SES_DOMAIN = module.email.mail_from_domain
BACKOFFICE_SESSION_COOKIE_SECRET = random_password.backoffice_session_cookie_secret.result

}
api_env_vars = {

BACKOFFICE_SESSION_COOKIE_NAME = "backoffice"
}
}
}

0 comments on commit c6f7209

Please sign in to comment.