Skip to content

Commit 9a67469

Browse files
committed
init
0 parents  commit 9a67469

File tree

11 files changed

+72513
-0
lines changed

11 files changed

+72513
-0
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules/
2+
*.log
3+
.env
4+
.DS_Store
5+
coverage/
6+
.nyc_output/
7+
.vscode/
8+
.idea/
9+
*.tgz
10+
*.tar.gz

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Static.app
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 305 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
# Static.app Deploy Action
2+
3+
Deploy your static sites and built applications to [Static.app](https://static.app) directly from GitHub Actions.
4+
5+
## Features
6+
7+
- 🚀 **Easy deployment** - Deploy static sites with a single action
8+
- 🔧 **Build support** - Automatically build your application before deployment
9+
- 🆕 **Create or update** - Create new sites or update existing ones
10+
- 📦 **Smart packaging** - Automatically excludes unnecessary files
11+
- 🎯 **Flexible** - Works with any static site generator or build tool
12+
13+
## Usage
14+
15+
### Basic Static Site Deployment
16+
17+
```yaml
18+
name: Deploy to Static.app
19+
on:
20+
push:
21+
branches: [ main ]
22+
23+
jobs:
24+
deploy:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v3
28+
29+
- name: Deploy to Static.app
30+
uses: designmodo/[email protected]
31+
with:
32+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
33+
build-dir: './'
34+
```
35+
36+
### Deploy Built Application (React, Vue, etc.)
37+
38+
```yaml
39+
name: Deploy Built App
40+
on:
41+
push:
42+
branches: [ main ]
43+
44+
jobs:
45+
deploy:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v3
49+
50+
- name: Deploy to Static.app
51+
uses: designmodo/[email protected]
52+
with:
53+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
54+
build-dir: 'dist'
55+
build-command: 'npm run build'
56+
install-command: 'npm ci'
57+
node-version: '18'
58+
```
59+
60+
### Update Existing Site (using PID)
61+
62+
```yaml
63+
name: Update Existing Site
64+
on:
65+
push:
66+
branches: [ main ]
67+
68+
jobs:
69+
deploy:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v3
73+
74+
- name: Deploy to Static.app
75+
uses: designmodo/[email protected]
76+
with:
77+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
78+
pid: 'ols2my1htk'
79+
build-dir: 'build'
80+
build-command: 'npm run build'
81+
```
82+
83+
## Inputs
84+
85+
| Input | Description | Required | Default |
86+
|-------|-------------|----------|---------|
87+
| `api-key` | Your Static.app API key | ✅ | - |
88+
| `pid` | Project PID to update (find in Site → Settings → General) | ❌ | - |
89+
| `build-dir` | Directory to deploy | ❌ | `./` |
90+
| `build-command` | Build command to run before deployment | ❌ | - |
91+
| `install-command` | Install command to run before build | ❌ | `npm ci` |
92+
| `node-version` | Node.js version to use | ❌ | `18` |
93+
| `exclude` | Files/directories to exclude (comma-separated) | ❌ | `node_modules,.git,.github,*.md,package*.json` |
94+
95+
## Outputs
96+
97+
| Output | Description |
98+
|--------|-------------|
99+
| `site-url` | The URL of the deployed site |
100+
| `deploy-url` | The deployment URL |
101+
102+
## Setup
103+
104+
### 1. Get Your API Key
105+
106+
1. Go to [Static.app](https://static.app)
107+
2. Sign in to your account
108+
3. Navigate to **Account → API Keys**
109+
4. Create a new API key
110+
5. Copy the generated key (starts with `sk_`)
111+
112+
### 2. Add API Key to GitHub Secrets
113+
114+
1. Go to your GitHub repository
115+
2. Navigate to **Settings → Secrets and variables → Actions**
116+
3. Click **New repository secret**
117+
4. Name: `STATIC_APP_API_KEY`
118+
5. Value: Your API key from Static.app
119+
6. Click **Add secret**
120+
121+
### 3. Create Workflow File
122+
123+
Create `.github/workflows/deploy.yml` in your repository:
124+
125+
```yaml
126+
name: Deploy to Static.app
127+
128+
on:
129+
push:
130+
branches: [ main ]
131+
132+
jobs:
133+
deploy:
134+
runs-on: ubuntu-latest
135+
steps:
136+
- name: Checkout
137+
uses: actions/checkout@v3
138+
139+
- name: Deploy to Static.app
140+
uses: designmodo/[email protected]
141+
with:
142+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
143+
# Add other inputs as needed
144+
```
145+
146+
## Examples
147+
148+
### React App
149+
150+
```yaml
151+
- name: Deploy React App
152+
uses: designmodo/[email protected]
153+
with:
154+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
155+
build-dir: 'build'
156+
build-command: 'npm run build'
157+
install-command: 'npm ci'
158+
```
159+
160+
### Vue.js App
161+
162+
```yaml
163+
- name: Deploy Vue App
164+
uses: designmodo/[email protected]
165+
with:
166+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
167+
build-dir: 'dist'
168+
build-command: 'npm run build'
169+
```
170+
171+
### Next.js Static Export
172+
173+
```yaml
174+
- name: Deploy Next.js App
175+
uses: designmodo/[email protected]
176+
with:
177+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
178+
build-dir: 'out'
179+
build-command: 'npm run build && npm run export'
180+
```
181+
182+
### Gatsby
183+
184+
```yaml
185+
- name: Deploy Gatsby Site
186+
uses: designmodo/[email protected]
187+
with:
188+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
189+
build-dir: 'public'
190+
build-command: 'npm run build'
191+
```
192+
193+
### Hugo
194+
195+
```yaml
196+
- name: Deploy Hugo Site
197+
uses: designmodo/[email protected]
198+
with:
199+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
200+
build-dir: 'public'
201+
build-command: 'hugo --minify'
202+
install-command: 'echo "No npm install needed"'
203+
```
204+
205+
### Jekyll
206+
207+
```yaml
208+
- name: Deploy Jekyll Site
209+
uses: designmodo/[email protected]
210+
with:
211+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
212+
build-dir: '_site'
213+
build-command: 'bundle exec jekyll build'
214+
install-command: 'bundle install'
215+
```
216+
217+
## Advanced Configuration
218+
219+
### Custom Exclusions
220+
221+
```yaml
222+
- name: Deploy with Custom Exclusions
223+
uses: designmodo/[email protected]
224+
with:
225+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
226+
exclude: 'node_modules,.git,*.log,temp,cache'
227+
```
228+
229+
### Multiple Node.js Versions
230+
231+
```yaml
232+
strategy:
233+
matrix:
234+
node-version: [16, 18, 20]
235+
236+
- name: Deploy with Node ${{ matrix.node-version }}
237+
uses: designmodo/[email protected]
238+
with:
239+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
240+
node-version: ${{ matrix.node-version }}
241+
```
242+
243+
### Using Outputs
244+
245+
```yaml
246+
- name: Deploy to Static.app
247+
id: deploy
248+
uses: designmodo/[email protected]
249+
with:
250+
api-key: ${{ secrets.STATIC_APP_API_KEY }}
251+
252+
- name: Comment PR with Deploy URL
253+
uses: actions/github-script@v6
254+
with:
255+
script: |
256+
github.rest.issues.createComment({
257+
issue_number: context.issue.number,
258+
owner: context.repo.owner,
259+
repo: context.repo.repo,
260+
body: '🚀 Deployed to: ${{ steps.deploy.outputs.site-url }}'
261+
})
262+
```
263+
264+
## Troubleshooting
265+
266+
### Common Issues
267+
268+
**❌ "API key is required"**
269+
- Make sure you've added `STATIC_APP_API_KEY` to your repository secrets
270+
- Verify the secret name matches exactly
271+
272+
**❌ "Build command failed"**
273+
- Check your build command syntax
274+
- Ensure all dependencies are properly installed
275+
- Verify the build directory exists after the build
276+
277+
**❌ "Invalid API key"**
278+
- Regenerate your API key in Static.app dashboard
279+
- Update the GitHub secret with the new key
280+
281+
**❌ "Site not found"**
282+
- If using `pid`, make sure the project exists and you have access
283+
- Remove `pid` to create a new site instead
284+
285+
### Debug Mode
286+
287+
Enable debug logging by adding this to your workflow:
288+
289+
```yaml
290+
env:
291+
ACTIONS_STEP_DEBUG: true
292+
```
293+
294+
## Support
295+
296+
- 📚 [Static.app Documentation](https://help.static.app/)
297+
- 📧 [Support Email](mailto:[email protected])
298+
299+
## License
300+
301+
MIT License - see [LICENSE](LICENSE) file for details.
302+
303+
---
304+
305+
Made with ❤️ by the [Static.app](https://static.app) team

action.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 'Static.app Deploy'
2+
description: 'Deploy your static site or built application to Static.app'
3+
author: 'Static.app'
4+
branding:
5+
icon: 'upload-cloud'
6+
color: 'blue'
7+
8+
inputs:
9+
api-key:
10+
description: 'Your Static.app API key'
11+
required: true
12+
pid:
13+
description: 'Project PID to update (Site → Settings → General)'
14+
required: false
15+
build-dir:
16+
description: 'Directory to deploy (default: ./)'
17+
required: false
18+
default: './'
19+
build-command:
20+
description: 'Build command to run before deployment (optional)'
21+
required: false
22+
install-command:
23+
description: 'Install command to run before build (default: npm ci)'
24+
required: false
25+
default: 'npm ci'
26+
node-version:
27+
description: 'Node.js version to use (default: 18)'
28+
required: false
29+
default: '18'
30+
exclude:
31+
description: 'Files/directories to exclude from deployment (comma-separated)'
32+
required: false
33+
default: 'node_modules,.git,.github,*.md,package*.json'
34+
35+
outputs:
36+
site-id:
37+
description: 'The ID of the deployed site'
38+
site-url:
39+
description: 'The URL of the deployed site'
40+
deploy-url:
41+
description: 'The deploy URL'
42+
43+
runs:
44+
using: 'node16'
45+
main: 'dist/index.js'

0 commit comments

Comments
 (0)