-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.06 KB
/
deploy.yml
File metadata and controls
40 lines (33 loc) · 1.06 KB
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
name: deploy_website
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Install dependencies
run: flutter pub get
- name: Build Flutter web
run: flutter build web --release --base-href /rostrix-website/
- name: Deploy to Separate Repository
env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
COMMIT_HASH: ${{ github.sha }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
cd build/web
git init
git add .
git commit -m "Deploy Version $(date +'%Y-%m-%d %H:%M:%S') - Commit $COMMIT_HASH"
git branch -M main
git remote add origin https://x-access-token:${PERSONAL_ACCESS_TOKEN}@github.com/devsticks/rostrix-website.git
git push -u -f origin main