Build and Deploy to Flex #1
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
name: Build and Deploy to Flex | |
env: | |
AZURE_FUNCTIONAPP_NAME: 'flex-demo-func-drhelius' | |
POM_XML_DIRECTORY: '.' | |
JAVA_VERSION: '17' | |
JAVA_DISTRIBUTION: 'microsoft' | |
on: | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
deploy-to-dev: | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log into Azure | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_FLEX_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
- name: Setup Java Sdk ${{ env.JAVA_VERSION }} | |
uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: ${{ env.JAVA_DISTRIBUTION }} | |
- name: 'Build Using Mvn' | |
shell: bash | |
run: | | |
pushd './${{ env.POM_XML_DIRECTORY }}' | |
mvn clean package | |
popd | |
- name: 'Run Azure Functions Action' | |
uses: Azure/functions-action@v1 | |
id: fa | |
with: | |
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} | |
package: '${{ env.POM_XML_DIRECTORY }}' | |
respect-pom-xml: true |