changing api to azure container app
This commit is contained in:
39
.github/workflows/api.yaml
vendored
39
.github/workflows/api.yaml
vendored
@@ -7,11 +7,12 @@ on:
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
environment: ${{ inputs.calling_workflow }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
@@ -29,9 +30,33 @@ jobs:
|
||||
run: |
|
||||
npm run build -w api
|
||||
|
||||
- name: Deploy
|
||||
uses: Azure/functions-action@v1
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log into Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
app-name: ${{ vars.API_FUNCTION_APP_NAME }}
|
||||
package: ${{ vars.API_FUNCTION_APP_PACKAGE_PATH }}
|
||||
publish-profile: ${{ secrets.API_FUNCTION_APP_PUBLISH_PROFILE }}
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push to registry
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: noahspan/flying-api:${{ github.run_id }}
|
||||
file: ./api/Dockerfile
|
||||
context: ./api
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
environment: ${{ inputs.calling_workflow }}
|
||||
needs: build
|
||||
steps:
|
||||
- name: Log in to Azure
|
||||
uses: azure/login@v2
|
||||
with:
|
||||
creds: ${{ secrets.AZURE_CREDENTIALS }}
|
||||
|
||||
- name: Update Container App
|
||||
run: |
|
||||
az container app update --name flying-api --resource-group noahspan --image noahspan-flying:${{ github.run_id }}
|
||||
|
||||
Reference in New Issue
Block a user