add title to db #35
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
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action | |
# More GitHub Actions for Azure: https://github.com/Azure/actions | |
name: Dev - Build and deploy languageapi-controller-func-nonprod-use2 | |
on: | |
push: | |
branches: | |
- dev | |
paths: | |
- controller/** | |
pull_request: | |
branches: | |
- dev | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
AZURE_FUNCTIONAPP_PACKAGE_PATH: "./controller" # set this to the path to your web app project, defaults to the repository root | |
NODE_VERSION: "18.x" # set this to the node version to use (supports 8.x, 10.x, 12.x) | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout GitHub Action" | |
uses: actions/checkout@v4 | |
- name: Setup Node ${{ env.NODE_VERSION }} Environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Load secret | |
uses: 1password/load-secrets-action@v2 | |
with: | |
# Export loaded secrets as environment variables | |
export-env: true | |
env: | |
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
DATABASE_URL: "op://AppDev Scripture Accessibility/languageapi-dev/connection string" | |
BUS_CONN: "op://AppDev Scripture Accessibility/languageapi-bus-con/dev/conn_string" | |
- name: "Load PNPM" | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 8 | |
- name: "Build and Test Controller" | |
shell: bash | |
run: | | |
pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}' | |
echo "node-linker=hoisted" > .npmrc | |
pnpm install | |
pnpm run --if-present build | |
pnpm run --if-present test | |
popd | |
- name: "Migrate DB" | |
env: | |
DATABASE_URL: ${{ env.DATABASE_URL }} | |
run: | | |
pushd ./controller | |
echo "node-linker=hoisted" > .npmrc | |
pnpm install | |
pnpm run migrate | |
popd | |
- name: "Run Azure Functions Action" | |
uses: Azure/functions-action@v1 | |
id: fa | |
with: | |
app-name: "languageapi-controller-func-nonprod-use2" | |
slot-name: "Production" | |
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }} | |
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_7AE02864666D4359B9AE7477C6094072 }} |