Skip to content

Commit

Permalink
push html to blob in dev2 for test
Browse files Browse the repository at this point in the history
  • Loading branch information
Administrator committed Oct 21, 2024
1 parent 76ebb41 commit eb9591a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 43 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build-deploy-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Build and Deploy Frontend

on:
workflow_dispatch:
push:
branches: enable-auto-scaling-tf
# workflow_dispatch:

permissions:
id-token: write
Expand All @@ -25,7 +27,7 @@ jobs:
- name: Install NPM packages
run: npm ci
- name: Build project
run: VITE_API_URL='https://reportvision-ocr-dev.azurewebsites.net/' npm run build
run: VITE_API_URL='https://reportvision-ocr-dev2.azurewebsites.net/' npm run build
- name: Run unit tests
run: npm run test
- name: Create client build archive
Expand All @@ -43,7 +45,7 @@ jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: build-frontend-dev
environment: dev2
needs: [build]
steps:
- name: Download Artifacts To Job
Expand All @@ -66,7 +68,7 @@ jobs:
- name: Upload to Azure blob storage
shell: bash
run: |
az storage blob upload-batch --account-name reportvisionfrontenddev -d '$web' -s client-build/ --overwrite
az storage blob upload-batch --account-name reportvisionfrontenddev2 -d '$web' -s client-build/ --overwrite
- name: Azure logout
shell: bash
run: |
Expand Down
77 changes: 38 additions & 39 deletions .github/workflows/build-deploy-ocr.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
name: Create, publish, deploy a OCR API image

on:
push:
branches: enable-auto-scaling-tf
# workflow_dispatch:
# inputs:
# tag:
# description: 'Version tag for new release'
# required: true
workflow_dispatch:
inputs:
tag:
description: 'Version tag for new release'
required: true

env:
REGISTRY: ghcr.io
VERSION: resusable-deploy-test-derek
VERSION: ${{ inputs.tag }}


jobs:
# build-and-push-image:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# attestations: write
# id-token: write
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Log in to the Container registry
# uses: docker/login-action@v3
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Lowercase the repo name
# run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
# # - name: Check if image exists
# # id: image_check
# # run: docker manifest inspect ${{ env.REGISTRY }}/${{ env.REPO }}-ocr-api:${{ env.VERSION }} > /dev/null ; echo $?
# - name: Build and push Docker image
# id: push
# uses: docker/build-push-action@v6
# with:
# context: ./OCR/
# file: ./OCR/Dockerfile
# push: true
# tags: ${{ env.REGISTRY }}/${{ env.REPO }}-ocr-api:${{ env.VERSION }}
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Lowercase the repo name
run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
# - name: Check if image exists
# id: image_check
# run: docker manifest inspect ${{ env.REGISTRY }}/${{ env.REPO }}-ocr-api:${{ env.VERSION }} > /dev/null ; echo $?
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: ./OCR/
file: ./OCR/Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ env.REPO }}-ocr-api:${{ env.VERSION }}

deploy:
runs-on: ubuntu-latest
Expand All @@ -52,7 +50,8 @@ jobs:
packages: write
attestations: write
id-token: write
environment: dev2
needs: build-and-push-image
environment: dev
steps:
- uses: azure/login@v2
with:
Expand All @@ -67,6 +66,6 @@ jobs:
id: deploy-to-webapp
uses: azure/webapps-deploy@v3
with:
app-name: reportvision-ocr-dev2
app-name: reportvision-ocr-dev
images: '${{ env.REGISTRY }}/${{ env.REPO}}-ocr-api:${{ env.VERSION }}'

0 comments on commit eb9591a

Please sign in to comment.