Skip to content

Commit

Permalink
Deploy to a Github Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
AshleighAdams committed Aug 4, 2023
1 parent 646285f commit 9878577
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@ defaults:
run:
shell: bash

# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
name: "Build"
Expand All @@ -21,6 +33,9 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Setup Pages
if: github.ref == 'refs/heads/master'
uses: actions/configure-pages@v3

- name: Setup .NET 7 SDK
uses: actions/setup-dotnet@v1
Expand All @@ -33,16 +48,44 @@ jobs:
- name: Setup Verlite
run: |
verlite_version="$(grep '"Verlite\.MsBuild"' WasmTest.csproj | LC_ALL=en_US.utf8 grep -Po 'Version="\K[^"]+')"
verlite_version="$(grep '"Verlite\.MsBuild"' src/WebGL.Sample/WebGL.Sample.csproj | LC_ALL=en_US.utf8 grep -Po 'Version="\K[^"]+')"
dotnet tool install --global Verlite.CLI --version "$verlite_version"
verlite . --auto-fetch --verbosity verbatim
- name: Publish
run: dotnet publish --configuration Release -p:OutDir=artifacts
run: |
dotnet publish --configuration Release -p:OutputPath="$(pwd)/build"
mv build/AppBundle artifacts
- name: Fix permissions
run: |
chmod -c -R +rX "artifacts/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
artifacts/*
- name: Upload Pages Artifacts
uses: actions/upload-pages-artifact@v2
if: github.ref == 'refs/heads/master'
with:
path: "artifacts"

# Deployment job
deploy:
name: "Deploy"
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 9878577

Please sign in to comment.