Skip to content

Commit

Permalink
add ll staging
Browse files Browse the repository at this point in the history
  • Loading branch information
notshivansh committed Feb 13, 2024
1 parent 826cf83 commit 2e54360
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 281 deletions.
258 changes: 0 additions & 258 deletions .github/workflows/staging-ii.yml

This file was deleted.

57 changes: 34 additions & 23 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,58 @@ on:
workflow_dispatch:

jobs:
build:
build-pre:
runs-on: ubuntu-latest
outputs:
IMAGE_TAG: ${{ steps.docker_tag.outputs.IMAGE_TAG }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
architecture: x64
- uses: actions/setup-node@v2
with:
node-version: '17'
- name: Convert github branch name to be compatible with docker tag name convention and generate tag name
id: docker_tag
run: echo "IMAGE_TAG=a-$(echo ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_OUTPUT
- name: Download Akto templates zip
working-directory: ./apps/dashboard/src/main/resources
run: wget -O test-library-master.zip https://github.com/akto-api-security/tests-library/archive/refs/heads/master.zip

build-frontend:
needs: build-pre
runs-on: ubuntu-latest
env:
IMAGE_TAG: ${{needs.build-pre.outputs.IMAGE_TAG}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '17'
- name: Prepare Dashboard UI
working-directory: ./apps/dashboard/
run: npm install && export RELEASE_VERSION=${{steps.docker_tag.outputs.IMAGE_TAG}} && npm run build
run: npm install && export RELEASE_VERSION=$IMAGE_TAG && npm run build
- name: Prepare Dashboard polaris UI
working-directory: ./apps/dashboard/web/polaris_web
run: npm install && export RELEASE_VERSION=${{steps.docker_tag.outputs.IMAGE_TAG}} && npm run build
run: npm install && export RELEASE_VERSION=$IMAGE_TAG && npm run build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}}
aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}}
aws-region: ap-south-1

- name: Deploy static site to S3 bucket
run: aws s3 sync ./apps/dashboard/web/dist s3://dashboard-on-cdn/web/${{steps.docker_tag.outputs.IMAGE_TAG}}/dist --delete
run: aws s3 sync ./apps/dashboard/web/dist s3://dashboard-on-cdn/web/$IMAGE_TAG/dist --delete
- name: Deploy polaris site to S3 bucket
run: aws s3 sync ./apps/dashboard/web/polaris_web/web/dist s3://dashboard-on-cdn/polaris_web/${{steps.docker_tag.outputs.IMAGE_TAG}}/dist --delete

run: aws s3 sync ./apps/dashboard/web/polaris_web/web/dist s3://dashboard-on-cdn/polaris_web/$IMAGE_TAG/dist --delete

build-backend:
needs: build-pre
runs-on: ubuntu-latest
env:
IMAGE_TAG: ${{needs.build-pre.outputs.IMAGE_TAG}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
architecture: x64
- name: Download Akto templates zip
working-directory: ./apps/dashboard/src/main/resources
run: wget -O test-library-master.zip https://github.com/akto-api-security/tests-library/archive/refs/heads/master.zip
- run: mvn package -Dakto-image-tag=${{ github.event.inputs.Tag }} -Dakto-build-time=$(eval "date +%s") -Dakto-release-version=${{steps.docker_tag.outputs.IMAGE_TAG}}
- name: DockerHub login
env:
Expand Down Expand Up @@ -95,19 +109,16 @@ jobs:
restore-keys: ${{ runner.os }}-m2

deploy:
needs: build
needs: [build-backend, build-frontend]
runs-on: ubuntu-latest
environment: Dev
permissions:
id-token: write
contents: read
env:
IMAGE_TAG: ${{needs.build.outputs.IMAGE_TAG}}
IMAGE_TAG: ${{needs.build-pre.outputs.IMAGE_TAG}}
FLASH_NLB_DNS: ${{ secrets.FLASH_NLB_DNS }}
FLASH_MONGO_CONN: ${{ secrets.FLASH_MONGO_CONN }}



outputs:
lb_name: ${{ steps.deploy_cluster.outputs.lb_name }}
steps:
Expand Down

0 comments on commit 2e54360

Please sign in to comment.