Skip to content

Commit 2ae2499

Browse files
committed
docs(guides): add GitHub Actions integration guide and update navigation
1 parent bcefa85 commit 2ae2499

File tree

4 files changed

+163
-0
lines changed

4 files changed

+163
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ For comprehensive documentation, visit [https://ftl-deploy.org](https://ftl-depl
1212
- Docker-based deployment with layer-optimized transfers
1313
- Real-time log streaming and monitoring
1414
- Secure SSH tunneling for remote dependencies
15+
- **GitHub Actions integration** for automated CI/CD workflows
1516

1617
## Requirements
1718

@@ -103,6 +104,33 @@ ftl validate
103104

104105
## Usage
105106

107+
### GitHub Actions Integration
108+
109+
Deploy automatically using the official FTL GitHub Action:
110+
111+
```yaml
112+
name: Deploy
113+
114+
on:
115+
push:
116+
branches: [main]
117+
118+
jobs:
119+
deploy:
120+
runs-on: ubuntu-latest
121+
steps:
122+
- uses: actions/checkout@v4
123+
124+
- name: Deploy with FTL
125+
uses: yarlson/ftl-deploy-action@v1
126+
with:
127+
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
128+
env:
129+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
130+
```
131+
132+
For complete GitHub Actions documentation, see the [integration guide](https://ftl-deploy.org/guides/github-actions) or visit the [action repository](https://github.com/yarlson/ftl-deploy-action).
133+
106134
### Configuration Validation
107135
108136
```bash

www/docs/guides/github-actions.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
title: GitHub Actions Integration
3+
description: Deploy with FTL using GitHub Actions workflows
4+
---
5+
6+
# GitHub Actions Integration
7+
8+
Deploy your applications automatically using FTL and GitHub Actions. The official FTL GitHub Action handles installation, SSH setup, and deployment in your CI/CD pipeline.
9+
10+
## Quick Start
11+
12+
Add the FTL Deploy action to your workflow:
13+
14+
```yaml
15+
name: Deploy
16+
17+
on:
18+
push:
19+
branches: [main]
20+
21+
jobs:
22+
deploy:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Deploy with FTL
28+
uses: yarlson/ftl-deploy-action@v1
29+
with:
30+
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
31+
env:
32+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
33+
```
34+
35+
## Setup
36+
37+
### 1. Prepare SSH Key
38+
39+
Generate a dedicated SSH key for deployments:
40+
41+
```bash
42+
ssh-keygen -t ed25519 -C "github-deploy" -f ~/.ssh/ftl_github
43+
```
44+
45+
Add the public key to your server's `~/.ssh/authorized_keys`.
46+
47+
### 2. Add SSH Key to GitHub Secrets
48+
49+
1. Go to repository Settings → Secrets and variables → Actions
50+
2. Click "New repository secret"
51+
3. Name: `SSH_PRIVATE_KEY`
52+
4. Value: Contents of `~/.ssh/ftl_github` (complete file)
53+
54+
### 3. Create Workflow File
55+
56+
Create `.github/workflows/deploy.yml` in your repository with the deployment workflow.
57+
58+
## Common Patterns
59+
60+
### Deploy on Tag
61+
62+
Deploy when you create a release tag:
63+
64+
```yaml
65+
on:
66+
push:
67+
tags:
68+
- "v*"
69+
```
70+
71+
### Deploy Staging and Production
72+
73+
Use different workflows or environments:
74+
75+
```yaml
76+
jobs:
77+
deploy-staging:
78+
if: github.ref == 'refs/heads/develop'
79+
# ... deploy to staging
80+
81+
deploy-production:
82+
if: github.ref == 'refs/heads/main'
83+
# ... deploy to production
84+
```
85+
86+
### First Deployment
87+
88+
For initial server setup, enable `run-setup`:
89+
90+
```yaml
91+
- uses: yarlson/ftl-deploy-action@v1
92+
with:
93+
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
94+
run-setup: "true"
95+
```
96+
97+
After the first deployment, remove or set to `'false'`.
98+
99+
## Action Reference
100+
101+
See the complete [action documentation](https://github.com/yarlson/ftl-deploy-action) for all inputs and advanced usage patterns.
102+
103+
## Troubleshooting
104+
105+
### Action Fails with SSH Error
106+
107+
Verify your SSH key in GitHub Secrets includes the complete key including BEGIN/END markers:
108+
109+
```
110+
-----BEGIN OPENSSH PRIVATE KEY-----
111+
...
112+
-----END OPENSSH PRIVATE KEY-----
113+
```
114+
115+
### Build Fails on Runner
116+
117+
Ensure your Dockerfile and build context are correctly configured in `ftl.yaml`. The action uses the same build process as local FTL.
118+
119+
### Environment Variables Not Working
120+
121+
Make sure environment variables are passed in the `env` section of the action step, not as `with` inputs.
122+
123+
## Next Steps
124+
125+
- [Configure health checks](/guides/health-checks) for zero-downtime deployments
126+
- [Set up monitoring](/core-tasks/logging) with FTL logs
127+
- [Review security best practices](/guides/security)

www/docs/guides/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ This section contains comprehensive guides for implementing advanced deployment
99

1010
## Available Guides
1111

12+
### [GitHub Actions Integration](./github-actions.md)
13+
14+
Learn how to deploy your applications automatically using FTL and GitHub Actions. This guide covers setup, SSH configuration, and common deployment patterns for CI/CD workflows.
15+
1216
### [Health Checks](./health-checks.md)
1317

1418
Learn how to implement robust health checks for your services to ensure reliable deployments and runtime monitoring. This guide covers configuration options, best practices, and troubleshooting common health check issues.

www/docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ Deploy your web applications to production servers without complexity. FTL handl
107107
<a href="/getting-started/first-deployment">Deploy Your First App</a>
108108
<span>Step-by-step guide to your first deployment</span>
109109
</li>
110+
<li>
111+
<a href="/guides/github-actions">GitHub Actions Integration</a>
112+
<span>Automate deployments with GitHub Actions</span>
113+
</li>
110114
<li>
111115
<a href="/guides/concepts">Core Concepts</a>
112116
<span>Learn the basics of deployment</span>

0 commit comments

Comments
 (0)