-
Notifications
You must be signed in to change notification settings - Fork 53
152 lines (134 loc) · 4.27 KB
/
buildanddeploy.yml
File metadata and controls
152 lines (134 loc) · 4.27 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Build and Deploy
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-and-deploy-gh-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install htmlc globally
run: npm install -g @sojs_coder/htmlc@1.3.5
# - name: Build Sitemap
# run: node generate_sitemap.js
- name: Build roms.json
env:
ROMS_AWS_ACCESS_KEY: ${{ secrets.ROMS_AWS_ACCESS_KEY }}
ROMS_AWS_SECRET_ACCESS_KEY: ${{ secrets.ROMS_AWS_SECRET_ACCESS_KEY }}
run: |
cd static/roms
npm install
node build.js
- name: Build static site
run: htmlc static --out=build
- name: Copy and Modify .gitattributes
run: |
node modify_gitattr.js
cp .gitattributes build/.gitattributes
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
publish_branch: gh-pages
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy: ${{ github.event.head_commit.message }}'
enable_jekyll: false
deploy-to-surge:
needs: build-and-deploy-gh-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm install -g surge
- run: surge --project ./ --domain ${{ secrets.SURGE_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }}
deploy-to-s3:
needs: build-and-deploy-gh-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.S3_UPLOAD_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.S3_UPLOAD_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Deploy to S3
run: |
aws s3 sync . s3://ccported --delete
sync-biggamescript:
needs: build-and-deploy-gh-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.S3_UPLOAD_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.S3_UPLOAD_AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Deploy to S3
run: |
ls
aws s3 sync big_game_script.js s3://ccportedgames/big_game_script.js --exact-timestamps
deploy-to-firebase:
needs: build-and-deploy-gh-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_CCPORTED }}
channelId: live
projectId: ccported
deploy-to-github-pages:
needs: build-and-deploy-gh-pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: gh-pages
lfs: true
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4