Update web-deploy.yml #10
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: Deploy to GitHub Pages | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
my_secret: ${{secrets.ACCESS_TOKEN}} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- run: | | |
cd dnd_spell_saver | |
flutter clean | |
- run: | | |
cd dnd_spell_saver | |
flutter pub get | |
- run: | | |
cd dnd_spell_saver | |
flutter build web --release | |
- run: python ./.github/workflows/href_remover.py | |
- run: | | |
cd dnd_spell_saver | |
cd build | |
mkdir web-deploy | |
cd web-deploy | |
git config --global user.email [email protected] | |
git config --global user.name rovati | |
git config --global init.defaultBranch main | |
git init | |
git remote add origin https://${{secrets.ACCESS_TOKEN}}@github.com/rovati/dnd-spell-saver.git | |
git fetch origin gh-pages | |
git switch gh-pages | |
cp -R ../web/* . | |
git status | |
git add . | |
echo "" | |
echo "Committing to gh-pages: ${{ github.event.head_commit.message }}" | |
echo "" | |
git commit -m "${{ github.event.head_commit.message }}" | |
git push origin gh-pages | |