Merge pull request #86 from Mystixor/dev #497
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
# Simple workflow for deploying static content to GitHub Pages | |
name: Deploy GbxExplorer to Pages | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["dev"] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build-gbxexplorer: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 8.0.x | |
- name: Create appsettings.json | |
uses: 1arp/create-a-file-action@0.2 | |
with: | |
path: Tools/GbxExplorer/Client/wwwroot | |
file: appsettings.json | |
content: | | |
{ | |
"Branch": "${{ github.ref_name }}", | |
"Commit": "${{ github.sha }}", | |
"BaseAddress": "/${{ github.event.repository.name }}" | |
} | |
- name: Publish | |
run: dotnet publish Tools/GbxExplorer/Client -c Release --nologo -o publish | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
- name: Change base in index.html to repository name | |
run: sed -i 's/<base href="\/" \/>/<base href="\/gbx-net\/" \/>/g' publish/wwwroot/index.html | |
- name: Add .nojekyll file | |
run: touch publish/wwwroot/.nojekyll | |
- name: Upload app artifact | |
uses: actions/upload-artifact@v3.1.0 | |
with: | |
name: app | |
path: publish/wwwroot | |
retention-days: 1 | |
deploy: | |
needs: build-gbxexplorer | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download app artifact | |
uses: actions/download-artifact@v3.0.0 | |
with: | |
name: app | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: . | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |