Merge pull request #27 from MITLibraries/USE-288-update-embeddings-wr… #5
This file contains hidden or 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 is the Terraform-generated stage-build.yml workflow for the ### | |
| ### timdex-embeddings-stage app repository. ### | |
| ### If this is a Lambda repo, uncomment the FUNCTION line at the end of ### | |
| ### the document. If the container requires any additional pre-build ### | |
| ### commands, uncomment and edit the PREBUILD line at the end of the ### | |
| ### document. ### | |
| name: Stage Container Build and Deploy | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '.github/**' | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| prep: | |
| name: Prep for Build | |
| runs-on: ubuntu-latest | |
| outputs: | |
| cpuarch: ${{ steps.setarch.outputs.cpuarch }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set CPU Architecture | |
| id: setarch | |
| run: | | |
| echo "### :abacus: Architecture Selection" >> $GITHUB_STEP_SUMMARY | |
| if [[ -f .aws-architecture ]]; then | |
| ARCH=$(cat .aws-architecture) | |
| echo "\`$ARCH\` was read from \`.aws-architecture\` and passed to the deploy job." >> $GITHUB_STEP_SUMMARY | |
| else | |
| ARCH="linux/amd64" | |
| echo "No \`.aws-architecture\` file, so default \`$ARCH\` was passed to the deploy job." >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [[ "$ARCH" != "linux/arm64" && "$ARCH" != "linux/amd64" ]]; then | |
| echo "$ARCH is INVALID architecture!" | |
| echo "$ARCH is INVALID architecture!" >> $GITHUB_STEP_SUMMARY | |
| exit 1 | |
| fi | |
| echo "cpuarch=$ARCH" >> $GITHUB_OUTPUT | |
| deploy: | |
| needs: prep | |
| name: Stage Deploy | |
| uses: mitlibraries/.github/.github/workflows/ecr-multi-arch-deploy-stage.yml@main | |
| secrets: inherit | |
| with: | |
| AWS_REGION: "us-east-1" | |
| GHA_ROLE: "timdex-embeddings-gha-stage" | |
| ECR: "timdex-embeddings-stage" | |
| CPU_ARCH: ${{ needs.prep.outputs.cpuarch }} | |
| # PREBUILD: |