Skip to content

build-and-deploy

build-and-deploy #360

name: build-and-deploy
on:
push:
branches:
- main
schedule:
- cron: '0 9 * * *' # daily at 09:00 - approximately some time after Geofabrik's OSM daily dump becomes available
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: browser-actions/setup-chrome@v1
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: cache/
key: osmalyzer-cache-${{ github.run_id }}
# restore nearest cache - i.e. previous cache
restore-keys: |
osmalyzer-cache
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
## One-step
#- run: dotnet run --project Osmalyzer --configuration Release --property:ExtraDefineConstants=REMOTE_EXECUTION
# Multiple steps
- run: dotnet restore
- run: dotnet build --configuration Release --no-restore --property:ExtraDefineConstants=REMOTE_EXECUTION
- run: dotnet run --project Osmalyzer --configuration Release --no-build
## Profile
#- run: dotnet restore
#- run: dotnet tool install --global dotnet-trace
#- run: dotnet build --configuration Release --no-restore --property:ExtraDefineConstants=REMOTE_EXECUTION
#- run: |
# export PATH="$PATH:$HOME/.dotnet/tools"
# dotnet run --project Osmalyzer --configuration Release --no-build & sleep 3
# dotnet-trace collect --name Osmalyzer --output ./whyareyouslow.nettrace
#- uses: actions/upload-artifact@v2
# with:
# path: ./whyareyouslow.nettrace
- uses: actions/upload-pages-artifact@v1
with:
path: output/
# Upload artifact (i.e. generated static website) to GitHub Pages
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
actions: read
runs-on: ubuntu-latest
steps:
- uses: actions/deploy-pages@v1