forked from flutterph/devs
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.45 KB
/
deploy.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
name: Deploy Flutter Website
on:
push:
branches: [ master ]
jobs:
build:
name: Deploy Website
runs-on: ubuntu-latest
env:
my_secret: ${{secrets.GH_DEPLOY}}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
channel: beta
- run: flutter config --enable-web
- run: flutter pub get
- run: flutter build web
- name: Build Artifact 🔧
uses: actions/upload-artifact@master
with:
name: web-artifact
path: build/web
- name: Copy CNAME
uses: canastro/copy-file-action@master
with:
source: CNAME
target: "test-a.txt"
- name: Download Artifact ⬇️
uses: actions/download-artifact@master
with:
name: web-artifact
- name: Change working directory
run: ls -R
working-directory: ./web
- name: Deploy 🚀
run: |
cd build/web
git init
git config --global user.email [email protected]
git config --global user.name joshuadeguzman
git remote add origin https://github.com/flutterph/devs.git
git fetch --all
git checkout origin/master CNAME
git remote remove origin
git remote add origin https://${{secrets.GH_DEPLOY}}@github.com/flutterph/devs.git
git checkout -b gh-pages
git add --all
git commit -m "Release new version"
git push origin gh-pages -f