Skip to content

Commit

Permalink
Merge pull request #1 from meg4cyberc4t/feature/create-a-customizations
Browse files Browse the repository at this point in the history
Create web_publish.yaml
  • Loading branch information
meg4cyberc4t authored Mar 16, 2024
2 parents 11c1004 + f782d40 commit 603f90f
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/web_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and deploy to pages

on:
push:
branches: ["main"]

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build_and_publish:
runs-on: windows-latest

steps:
- name: Git checkout
uses: actions/checkout@v3

- name: Setup FVM
uses: kuhnroyal/flutter-fvm-config-action@v1
id: fvm-config-action

- name: Setup Flutter
uses: subosito/flutter-action@v2
id: setup-flutter
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:"
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:"
architecture: x64

- name: Install Dependencies
run: |
flutter config --no-analytics
flutter pub get
- name: build
run: flutter build web --dart-define-from-file config/config_production.json --web-renderer skwasm --pwa-strategy offline-first --base-href /web_template --release

- run: |
cd build/web
git init
git config --global user.email github-actions[bot]@users.noreply.github.com
git config --global user.name github-ci[bot]
git status
git remote add origin https://${{secrets.TOKEN}}@github.com/meg4cyberc4t/webpage.git
git checkout -b gh-pages
git add --all
git commit -m "Deploy to pages"
git push origin gh-pages -f

0 comments on commit 603f90f

Please sign in to comment.