Skip to content

Combine SetHandling and CollectionExtensions #188

Combine SetHandling and CollectionExtensions

Combine SetHandling and CollectionExtensions #188

Workflow file for this run

name: Deploy tag to Azure
on:
push:
tags:
- "*"
branches:
- "main"
workflow_dispatch:
concurrency:
group: deploy-azure
permissions:
id-token: write
contents: read
jobs:
build-dotnet:
name: Build and deploy
runs-on: ubuntu-latest
environment: azure
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
- name: Restore workloads
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore
- name: Build release
run: dotnet build --configuration Release
- name: Publish
run: dotnet publish src/WebApp --configuration Release --output src/WebApp/bin/publish --runtime linux-x64 --no-self-contained /p:PublishReadyToRun=true
- name: Azure login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Deploy staging
id: deploy-staging
uses: azure/webapps-deploy@v2
with:
app-name: factoriotools-staging
package: src/WebApp/bin/publish
- name: Send test request
run: |
# cannot use --fail-with-body until https://github.com/curl/curl/issues/9078 makes it into Ubuntu
curl \
--request POST \
--header "Content-Type: application/json" \
--user-agent "GitHub Actions workflow ''$GITHUB_WORKFLOW''" \
--data "{\"blueprint\":\"$BLUEPRINT\"}" \
--fail \
--retry 5 \
"$WEBAPP_URL/api/v1/oil-field/plan"
env:
BLUEPRINT: "0eJyMj70OwjAMhN/lZg8NbHkVhFB/rMrQuFGSIqoq707aMiCVgcWSz+fP5wXNMLEPogl2gbSjRtjLgii91sOqae0YFn5y/l63DxDS7FdFEjtkgmjHL1iTrwTWJEl4Z2zNfNPJNRyKgX6w/BjLwqjrpQI5E+ZSC7WTwO0+qTIdYKc/YKbaaOaAK0G38Pbre8KTQ/wY8hsAAP//AwAEfF3F"
WEBAPP_URL: "${{ steps.deploy-staging.outputs['webapp-url'] }}"
- name: Test
run: dotnet test --no-build --configuration Release --logger "console;verbosity=normal"
- name: Deploy
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v') }}
id: deploy
uses: azure/webapps-deploy@v2
with:
app-name: factoriotools
package: src/WebApp/bin/publish
- name: Send test request
if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/v') }}
run: |
# cannot use --fail-with-body until https://github.com/curl/curl/issues/9078 makes it into Ubuntu
curl \
--request POST \
--header "Content-Type: application/json" \
--user-agent "GitHub Actions workflow ''$GITHUB_WORKFLOW''" \
--data "{\"blueprint\":\"$BLUEPRINT\"}" \
--fail \
--retry 5 \
"$WEBAPP_URL/api/v1/oil-field/plan"
env:
BLUEPRINT: "0eJyMj70OwjAMhN/lZg8NbHkVhFB/rMrQuFGSIqoq707aMiCVgcWSz+fP5wXNMLEPogl2gbSjRtjLgii91sOqae0YFn5y/l63DxDS7FdFEjtkgmjHL1iTrwTWJEl4Z2zNfNPJNRyKgX6w/BjLwqjrpQI5E+ZSC7WTwO0+qTIdYKc/YKbaaOaAK0G38Pbre8KTQ/wY8hsAAP//AwAEfF3F"
WEBAPP_URL: "${{ steps.deploy.outputs['webapp-url'] }}"