Triggered for branch/tag refs/heads/main #5
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: Deploy integration to Azure | |
run-name: Triggered for branch/tag ${{ github.ref }} | |
env: | |
AZURE_WEBAPP_NAME: benchscape-integration | |
AZURE_PUBLISH_PROFILE: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_BENCHSCAPE_INTEGRATION }} | |
AZURE_FRONTEND_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_BENCHSCAPE_INTEGRATION }} | |
JAVA_VERSION: '17' | |
DISTRIBUTION: temurin | |
FRONTEND_LOCATION: "jmh-frontend/src/main/frontend/build" | |
SERVER_LOCATION: "${{ github.workspace }}/jmh-store/target/*.jar" | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Java version | |
uses: actions/[email protected] | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: ${{ env.DISTRIBUTION }} | |
cache: 'maven' | |
- name: Set up npm cache | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: Build with Maven | |
run: mvn verify | |
- name: Upload Server to Azure | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: ${{ env.AZURE_WEBAPP_NAME }} | |
publish-profile: ${{ env.AZURE_PUBLISH_PROFILE }} | |
package: ${{ env.SERVER_LOCATION }} | |
- name: Upload Frontend to Azure | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ env.AZURE_FRONTEND_TOKEN }} | |
action: "upload" | |
skip_app_build: true | |
app_location: ${{ env.FRONTEND_LOCATION }} | |