.NET Core Build and Deploy to GitHub Pages #120
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
name: .NET Core Build and Deploy to GitHub Pages | |
on: | |
push: | |
branches: [ "main" ] | |
schedule: | |
- cron: '0 * * * *' | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Run Project | |
run: dotnet run --project status.csproj -webhook ${{ secrets.DISCORD_TOKEN }} | |
- name: Prepare for Commit | |
run: | | |
git config http.sslVerify false | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
git remote add publisher "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" | |
git show-ref | |
git branch --verbose | |
git lfs install | |
git checkout main | |
git add -A | |
git commit -m "Automated publish" || echo "No changes to commit, proceeding" | |
git pull --rebase publisher main | |
git push publisher main | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs | |
cname: api.status.blockcore.net |