-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (60 loc) · 2.01 KB
/
deploy_github_pages.yml
File metadata and controls
66 lines (60 loc) · 2.01 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
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
name: Deploy WebGL artifact to GitHub Pages
on:
workflow_run:
workflows: ["Builds + Test"]
types: [completed]
branches: [develop]
workflow_dispatch:
inputs:
workflow_run_id:
description: "ID of run from Builds + Test workflow"
required: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Github Pages branch
uses: actions/checkout@v5
with:
path: repo
ref: gh-pages
token: ${{ secrets.GHTOKEN }}
repository: "Studio-Lovelies/GG-JointJustice-Web-Dev"
- name: Delete old deployment
run: |
mkdir git
cd repo
mv .git/* ../git
rm -rf *
mv ../git/* .git
cd ..
- name: Download new deployment via workflow_run
uses: dawidd6/action-download-artifact@v14
if: github.event.workflow_run.conclusion == 'success'
with:
github_token: ${{ secrets.GHTOKEN }}
run_id: ${{ github.event.workflow_run.id }}
name: WebGL
name_is_regexp: true
repo: Studio-Lovelies/GG-JointJustice-Unity
path: repo
- name: Download new deployment via workflow_dispatch
uses: dawidd6/action-download-artifact@v14
if: github.event_name == 'workflow_dispatch'
with:
github_token: ${{ secrets.GHTOKEN }}
run_id: ${{ github.event.inputs.workflow_run_id }}
name: WebGL
name_is_regexp: true
repo: Studio-Lovelies/GG-JointJustice-Unity
path: repo
- name: Commit and push files
run: |
mv repo/WebGL*/* repo/
mv repo/Game*/* repo/
cd repo
git config --local user.email "gh-pages@example.org"
git config --local user.name "GitHub Pages"
git add .
git commit -m "Deploy to GitHub Pages" || echo "No changes to commit"
git push || echo "No changes to push"