Skip to content

Update db-migrations.md #117

Update db-migrations.md

Update db-migrations.md #117

Workflow file for this run

name: Build
permissions:
contents: write
on:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/[email protected]
- name: setup .net core
uses: actions/[email protected]
with:
dotnet-version: 6.0.100
- name: build
working-directory: ./MyApp
run: dotnet build .
- name: Assign default GitHub URL base path
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
custom_domain=$(gh api "/repos/${{ github.repository }}/pages" | jq -r '.cname // empty')
echo "CNAME config detected: $custom_domain"
repo_name=$(echo ${{ github.repository }} | cut -d '/' -f 2)
org_name=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
if [ ! -f "./MyApp/wwwroot/CNAME" ] && [ -z "$custom_domain" ]
then
echo "ssg_base_href=$(echo https://$org_name.github.io/$repo_name/)"
echo "ssg_base_href=$(echo https://$org_name.github.io/$repo_name/)" >> $GITHUB_ENV
else
if [ ! -z "$custom_domain" ]
then
echo "Persist CNAME '$custom_domain' to ./MyApp/wwwroot/CNAME"
echo "$custom_domain" >> ./MyApp/wwwroot/CNAME
echo "custom_domain=$custom_domain" >> $GITHUB_ENV
fi
fi
- name: Build tailwind
working-directory: ./MyApp
run: |
npm run build
- name: prerender
working-directory: ./MyApp
run: |
site_base_href=${{ env.ssg_base_href }}
site_base_url="https://${{ env.custom_domain }}"
if [ ! -z "$site_base_href" ]
then
echo "Prerendering for deployment to $site_base_href"
dotnet run --AppTasks=prerender --environment Production --BaseHref "$site_base_href"
else
echo "Prerendering for deployment to $custom_domain"
dotnet run --AppTasks=prerender --environment Production --BaseUrl "$site_base_url"
fi
# Deploy UI to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./MyApp/dist
user_name: 'GitHub Action'
user_email: '[email protected]'