-
Notifications
You must be signed in to change notification settings - Fork 4
86 lines (82 loc) · 2.85 KB
/
pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Workflow for deploying contents of Sosaku for web to GitHub Pages
name: Sosaku for Web
on:
# Triggered from Codemagic workflow or contributors.
repository_dispatch:
workflow_dispatch:
inputs:
user:
description: 'Your GitHub user name'
required: true
type: string
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Repository
id: version
run: |
REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##")
echo ::set-output name=repository::$REPOSITORY
- name: Install Flutter latest environment
uses: subosito/flutter-action@v2
with:
flutter-version: '3.3.4'
channel: 'stable'
cache: true
- name: Pre-build process
run: |
flutter doctor -v
flutter clean
flutter pub get
flutter gen-l10n
flutter pub run icons_launcher:create
flutter pub run flutter_native_splash:create
- name: Build Sosaku for Web
# If you use default URL (do not use custom domain), --base-href option is required.
run: flutter build web --verbose --release --build-number=${{ github.event.client_payload.build_number }} --web-renderer canvaskit --base-href /${{ steps.version.outputs.repository }}/
- name: Upload artifacts to GitHub Pages
uses: actions/upload-pages-artifact@v1
with:
path: './build/web'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
# Define Discord description
- name: Pre-notification process
if: always()
env:
job_status: ${{ job.status }}
run: |
if [ "${job_status}" == "success" ]; then
echo "description=Please try the latest build [here](https://w-sharp-tcu.github.io/sosaku/)!" >> $GITHUB_ENV
else
echo "description=Please check the details of the latest build results [here](https://github.com/W-sharp-TCU/sosaku/deployments/activity_log?environment=github-pages)." >> $GITHUB_ENV
fi
shell: bash
# Notify Discord Channel
- name: Notify Discord
uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
username: GitHub Actions
nocontext: true
title: "deploy to GitHub Pages"
description: ${{ env.description }}