Skip to content

Commit

Permalink
Update github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sunarya-thito committed Feb 24, 2025
1 parent fb3baae commit 7aa6c96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,49 +24,59 @@ jobs:
- name: Install Release Version
run: flutter pub add shadcn_flutter
working-directory: './docs'
continue-on-error: true

- name: Download Dependencies Release Version
run: flutter pub get
working-directory: './docs'

- name: Build Release Version
run: "flutter build web --wasm --base-href \"/shadcn_flutter/\""
continue-on-error: true
working-directory: './docs'

- name: Copy to web build directory
run: cp -r ./docs/build/web ./docs/public
continue-on-error: true
working-directory: './'

- name: Install Experimental Version
run: "flutter pub add 'shadcn_flutter:{\"git\":\"https://github.com/sunarya-thito/shadcn_flutter.git\"}'"
continue-on-error: true
working-directory: './docs'

- name: Download Dependencies Experimental Version
run: flutter pub get
working-directory: './docs'
continue-on-error: true

- name: Build Experimental Version
run: "flutter build web --wasm --base-href \"/shadcn_flutter/experimental/\""
working-directory: './docs'
continue-on-error: true

- name: Copy to web build directory
run: cp -r ./docs/build/web ./docs/public/experimental
working-directory: './'
continue-on-error: true

- name: Copy release version config file # from ./docs/config/docs-release.json to ./docs/public/assets/docs.json
run: cp ./docs/config/docs-release.json ./docs/public/assets/docs.json
working-directory: './'
continue-on-error: true

- name: Copy experimental version config file # from ./docs/config/docs-experimental.json to ./docs/public/experimental/assets/docs.json
run: cp ./docs/config/docs-experimental.json ./docs/public/experimental/assets/docs.json
working-directory: './'
continue-on-error: true

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: './docs/public'
force_orphan: true
user_name: 'github-ci[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Publish to gh-pages'
keep_files: true
6 changes: 4 additions & 2 deletions docs/lib/pages/docs_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,15 @@ class DocsPageState extends State<DocsPage> {
MenuButton(
child: Text(getReleaseTagName()),
onPressed: (context) {
launchUrlString('https://sunarya-thito.github.io/shadcn_flutter/');
launchUrlString(
'https://sunarya-thito.github.io/shadcn_flutter/');
},
),
MenuButton(
child: Text('Experimental'),
onPressed: (context) {
launchUrlString('https://sunarya-thito.github.io/shadcn_flutter/experimental/')
launchUrlString(
'https://sunarya-thito.github.io/shadcn_flutter/experimental/');
},
),
],
Expand Down

0 comments on commit 7aa6c96

Please sign in to comment.