Merge pull request #81 from nicolgit/main #29
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
name: deploy to green-desert | |
on: | |
push: | |
branches: | |
- deploy | |
jobs: | |
build_and_deploy_job: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
runs-on: ubuntu-latest | |
name: Build and Deploy Job | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
lfs: false | |
- name: replace build date and number | |
id: step_replace | |
# encode connection string with https://dwaves.de/tools/escape/ !! | |
run: | | |
echo "build timestamp: ${{ env.build_timestamp }}" | |
echo "run number: ${{ github.run_number }}" | |
builddate=$(date +%Y.%m.%d).github | |
# adding builds executed outside this workflow | |
my_build_number=$((49+${{ github.run_number }})) | |
echo "environment build date: $builddate" | |
echo "my build number: $my_build_number" | |
sed -i "s/__BUILDDATE__/$builddate (build $my_build_number)/g" firewall-mon-app/src/environments/environment.prod.ts | |
sed -i "s/__APPLICATION_INSIGHTS_CONNECTION_STRING__/${{ secrets.APPLICATION_INSIGHTS_CONNECTION_STRING }}/g" firewall-mon-app/src/environments/environment.prod.ts | |
cat firewall-mon-app/src/environments/environment.prod.ts | |
- name: Build And Deploy | |
id: builddeploy | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GREEN_DESERT_0923F7E10 }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) | |
action: "upload" | |
###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### | |
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig | |
app_location: "./firewall-mon-app" # App source code path | |
api_location: "./firewall-mon-api" # Api source code path - optional | |
output_location: "dist/firewall-mon-app" # Built app content directory - optional | |
###### End of Repository/Build Configurations ###### | |
close_pull_request_job: | |
if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
runs-on: ubuntu-latest | |
name: Close Pull Request Job | |
steps: | |
- name: Close Pull Request | |
id: closepullrequest | |
uses: Azure/static-web-apps-deploy@v1 | |
with: | |
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_GREEN_DESERT_0923F7E10 }} | |
action: "close" |