generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix docker image check for faster OCR deployments #354
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7c4645c
Try to fix Docker image check
2c46265
try with new image name
077ec3e
try with full workflow
6edde15
try with new image in full workflow
3c1095e
wip
8185d29
wip
ed944d9
fixed
d4d5622
test frontend workflow with changes
4a8f6cb
test frontend workflow with changes
a52b162
test ocr build and deploy with changes
e97b4e7
test with already registered docker images
3007c3a
clean-up worked
6e8c1f0
wip
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,8 @@ on: | |
type: choice | ||
options: | ||
- dev | ||
- dev2 | ||
- dev3 | ||
- dev4 | ||
- dev5 | ||
- dev6 | ||
- demo | ||
demo-blob-name: | ||
storage-account-name: | ||
description: 'After the demo env gets created, copy its blob storage name here' | ||
required: false | ||
|
||
|
@@ -24,55 +19,34 @@ permissions: | |
contents: read | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
build-frontend: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: frontend | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/build-frontend | ||
name: Build frontend | ||
with: | ||
node-version: '20' | ||
- name: Install NPM packages | ||
run: npm ci | ||
- name: Build project | ||
run: VITE_API_URL='https://reportvision-ocr-${{ inputs.deploy-env }}.azurewebsites.net/' npm run build | ||
- name: Run unit tests | ||
run: npm run test | ||
- name: Create client build archive | ||
shell: bash | ||
run: | | ||
echo "::group::Create application archive" | ||
tar -C ./dist/ -czf ./client.tgz . | ||
echo "::endgroup::" | ||
- name: Upload production-ready build files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: production-files | ||
path: ./frontend/client.tgz | ||
api-endpoint: https://reportvision-ocr-${{ inputs.deploy-env }}.azurewebsites.net/ | ||
frontend-tarball: ./frontend.tgz | ||
frontend-path: ./frontend | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. def doing a lot of scope creeping on this PR but its a needed clean-up. |
||
frontend-build-path: ./frontend/dist/ | ||
node-version: 20 | ||
|
||
deploy: | ||
deploy-with-blob-name-optional: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.deploy-env }} | ||
needs: [build] | ||
needs: [build-frontend] | ||
steps: | ||
- name: Download Artifacts To Job | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: production-files | ||
name: frontend-tarball | ||
- name: Unpack client | ||
shell: bash | ||
run: | | ||
echo "::group::Unpack client" | ||
mkdir client-build; | ||
tar -C client-build -zxvf client.tgz | ||
echo "::endgroup::" | ||
mkdir frontend-deploy; | ||
tar -C frontend-deploy -zxvf frontend.tgz | ||
- name: Azure login | ||
uses: azure/login@v2 | ||
with: | ||
|
@@ -82,10 +56,10 @@ jobs: | |
- name: Upload to Azure blob storage | ||
shell: bash | ||
run: | | ||
if [ -z "${{ inputs.demo-blob-name }}" ]; then | ||
az storage blob upload-batch --account-name reportvisionfrontend${{ inputs.deploy-env }} -d '$web' -s client-build/ --overwrite | ||
if [ -z "${{ inputs.storage-account-name }}" ]; then | ||
az storage blob upload-batch --account-name reportvisionfrontend${{ inputs.deploy-env }} -d '$web' -s frontend-deploy/ --overwrite | ||
else | ||
az storage blob upload-batch --account-name ${{ inputs.demo-blob-name }} -d '$web' -s client-build/ --overwrite | ||
az storage blob upload-batch --account-name ${{ inputs.storage-account-name }} -d '$web' -s frontend-deploy/ --overwrite | ||
fi | ||
- name: Azure logout | ||
shell: bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the npm packages being installed in the
./frontend.tgz
file?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats correct. at least with GHA, packaging all the frontend files into a tarball/zip makes downloading from other jobs smoother.