Skip to content

Commit ce48811

Browse files
committed
feat: ci/cd
1 parent dc680b9 commit ce48811

File tree

8 files changed

+266
-4
lines changed

8 files changed

+266
-4
lines changed

.dockerignore

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
# flyctl launch added from .build/checkouts/JavaScriptKit/.gitignore
2+
.build/checkouts/JavaScriptKit/**/dist
3+
.build/checkouts/JavaScriptKit/**/node_modules
4+
.build/checkouts/JavaScriptKit/**/.DS_Store
5+
.build/checkouts/JavaScriptKit/**/.build
6+
.build/checkouts/JavaScriptKit/Packages
7+
.build/checkouts/JavaScriptKit/*.xcodeproj
8+
.build/checkouts/JavaScriptKit/**/xcuserdata
9+
.build/checkouts/JavaScriptKit/**/.swiftpm
10+
.build/checkouts/JavaScriptKit/**/.vscode
11+
.build/checkouts/JavaScriptKit/**/Examples/*/Bundle
12+
.build/checkouts/JavaScriptKit/**/Examples/*/package-lock.json
13+
.build/checkouts/JavaScriptKit/**/Package.resolved
14+
.build/checkouts/JavaScriptKit/**/Plugins/BridgeJS/Sources/JavaScript/package-lock.json
15+
.build/checkouts/JavaScriptKit/**/Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/**/*.actual
16+
.build/checkouts/JavaScriptKit/**/bridge-js.config.local.json
17+
.build/checkouts/JavaScriptKit/**/_site
18+
19+
# flyctl launch added from .build/checkouts/JavaScriptKit/Runtime/.gitignore
20+
.build/checkouts/JavaScriptKit/Runtime/lib
21+
.build/checkouts/JavaScriptKit/Runtime/node_modules
22+
23+
# flyctl launch added from .build/checkouts/SwiftVan/.gitignore
24+
# Xcode
25+
#
26+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
27+
28+
## User settings
29+
.build/checkouts/SwiftVan/**/xcuserdata
30+
31+
## Obj-C/Swift specific
32+
.build/checkouts/SwiftVan/**/*.hmap
33+
34+
## App packaging
35+
.build/checkouts/SwiftVan/**/*.ipa
36+
.build/checkouts/SwiftVan/**/*.dSYM.zip
37+
.build/checkouts/SwiftVan/**/*.dSYM
38+
39+
## Playgrounds
40+
.build/checkouts/SwiftVan/**/timeline.xctimeline
41+
.build/checkouts/SwiftVan/**/playground.xcworkspace
42+
43+
# Swift Package Manager
44+
#
45+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
46+
# Packages/
47+
# Package.pins
48+
# Package.resolved
49+
# *.xcodeproj
50+
#
51+
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
52+
# hence it is not needed unless you have added a package configuration file to your project
53+
# .swiftpm
54+
55+
.build/checkouts/SwiftVan/**/.build
56+
57+
# CocoaPods
58+
#
59+
# We recommend against adding the Pods directory to your .gitignore. However
60+
# you should judge for yourself, the pros and cons are mentioned at:
61+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
62+
#
63+
# Pods/
64+
#
65+
# Add this line if you want to avoid checking in source code from the Xcode workspace
66+
# *.xcworkspace
67+
68+
# Carthage
69+
#
70+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
71+
# Carthage/Checkouts
72+
73+
.build/checkouts/SwiftVan/**/Carthage/Build
74+
75+
# fastlane
76+
#
77+
# It is recommended to not store the screenshots in the git repo.
78+
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
79+
# For more information about the recommended setup visit:
80+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
81+
82+
.build/checkouts/SwiftVan/**/fastlane/report.xml
83+
.build/checkouts/SwiftVan/**/fastlane/Preview.html
84+
.build/checkouts/SwiftVan/**/fastlane/screenshots/**/*.png
85+
.build/checkouts/SwiftVan/**/fastlane/test_output
86+
87+
# Logs
88+
.build/checkouts/SwiftVan/**/logs
89+
.build/checkouts/SwiftVan/**/*.log
90+
.build/checkouts/SwiftVan/**/npm-debug.log*
91+
.build/checkouts/SwiftVan/**/yarn-debug.log*
92+
.build/checkouts/SwiftVan/**/yarn-error.log*
93+
.build/checkouts/SwiftVan/**/lerna-debug.log*
94+
95+
# Dependencies
96+
.build/checkouts/SwiftVan/**/node_modules
97+
98+
# Production
99+
.build/checkouts/SwiftVan/build
100+
.build/checkouts/SwiftVan/dist
101+
.build/checkouts/SwiftVan/public/build
102+
.build/checkouts/SwiftVan/public/dist
103+
104+
# Environment variables
105+
.build/checkouts/SwiftVan/**/.env
106+
.build/checkouts/SwiftVan/**/.env.local
107+
.build/checkouts/SwiftVan/**/.env.development.local
108+
.build/checkouts/SwiftVan/**/.env.test.local
109+
.build/checkouts/SwiftVan/**/.env.production.local
110+
111+
# IDE and OS specific files
112+
.build/checkouts/SwiftVan/**/.DS_Store
113+
.build/checkouts/SwiftVan/**/.vscode
114+
.build/checkouts/SwiftVan/**/*.sublime-project
115+
.build/checkouts/SwiftVan/**/*.sublime-workspace
116+
.build/checkouts/SwiftVan/**/.swiftpm/xcode/package.xcworkspace
117+
118+
# flyctl launch added from .build/checkouts/swift-syntax/.gitignore
119+
# Ignore Swift Package Manager build artifacts directory.
120+
.build/checkouts/swift-syntax/**/.build
121+
.build/checkouts/swift-syntax/**/.*-build
122+
# Ignore generated Xcode projects
123+
.build/checkouts/swift-syntax/**/*.xcodeproj
124+
# Ignore SwiftPM state, such as the generated xcodeproj when opening the project directly
125+
.build/checkouts/swift-syntax/**/.swiftpm
126+
# Ignore user state in Xcode Projects
127+
.build/checkouts/swift-syntax/**/*.xcuserdatad
128+
.build/checkouts/swift-syntax/**/UserInterfaceState.xcuserstate
129+
.build/checkouts/swift-syntax/**/xcuserdata
130+
131+
# Ignore VScode workspace settings and launch configurations
132+
.build/checkouts/swift-syntax/**/.vscode
133+
134+
# Ignore bazel symlinks
135+
.build/checkouts/swift-syntax/bazel-*
136+
137+
# Ignore cmake build configuration and output
138+
.build/checkouts/swift-syntax/**/build
139+
140+
# We always build swiftSyntax of trunk dependencies. Ignore any fixed
141+
# dependency versions.
142+
.build/checkouts/swift-syntax/**/Package.resolved
143+
144+
.build/checkouts/swift-syntax/**/.DS_Store
145+
.build/checkouts/swift-syntax/**/*.pyc
146+
147+
.build/checkouts/swift-syntax/**/Tests/PerformanceTest/baselines.json
148+
149+
# The local build of swift-format to format swift-syntax
150+
.build/checkouts/swift-syntax/**/.swift-format-build
151+
152+
# flyctl launch added from .gitignore
153+
**/.swiftformat
154+
155+
**/.build/**
156+
**/node_modules
157+
fly.toml

.github/workflows/fly-deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/
2+
3+
name: Fly Deploy
4+
on:
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
deploy:
10+
name: Deploy app
11+
runs-on: ubuntu-latest
12+
concurrency: deploy-group # optional: ensure only one action runs at a time
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: superfly/flyctl-actions/setup-flyctl@master
16+
- run: flyctl deploy --remote-only
17+
env:
18+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# --------------------------------------------------
2+
# Stage 1: Swift WASM Build
3+
# --------------------------------------------------
4+
FROM swift:6.1-jammy AS builder
5+
6+
WORKDIR /app
7+
8+
# Install Node.js (for npm scripts)
9+
RUN apt-get update && \
10+
apt-get install -y curl && \
11+
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
12+
apt-get install -y nodejs && \
13+
rm -rf /var/lib/apt/lists/*
14+
15+
RUN swift sdk install "https://github.com/swiftwasm/swift/releases/download/swift-wasm-6.1-RELEASE/swift-wasm-6.1-RELEASE-wasm32-unknown-wasi.artifactbundle.zip" \
16+
--checksum "7550b4c77a55f4b637c376f5d192f297fe185607003a6212ad608276928db992"
17+
18+
# Copy manifests first (better caching)
19+
COPY Package.swift Package.resolved ./
20+
COPY package.json package-lock.json* ./
21+
22+
RUN npm install
23+
24+
# Copy full project
25+
COPY . .
26+
27+
# Build Swift → WASM
28+
RUN npm run build:main
29+
30+
# --------------------------------------------------
31+
# Stage 2: Assemble dist (structure preserved)
32+
# --------------------------------------------------
33+
FROM node:20-slim AS dist
34+
35+
WORKDIR /dist
36+
37+
# Copy static assets
38+
COPY --from=builder /app/index.html ./index.html
39+
COPY --from=builder /app/assets ./assets
40+
COPY --from=builder /app/.build ./.build
41+
42+
# Sanity checks (fail fast)
43+
RUN test -f .build/plugins/PackageToJS/outputs/Package/index.js && \
44+
test -f .build/plugins/PackageToJS/outputs/Package/portfolio.wasm
45+
46+
# --------------------------------------------------
47+
# Stage 3: Static runtime (nginx)
48+
# --------------------------------------------------
49+
FROM nginx:alpine AS production
50+
51+
COPY --from=dist /dist /usr/share/nginx/html
52+
53+
COPY nginx.conf /etc/nginx/conf.d/default.conf
54+
55+
EXPOSE 80
56+
CMD ["nginx", "-g", "daemon off;"]

Sources/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ nonisolated(unsafe) let projects = State([
2323
description:
2424
"Automation-first platform and tooling focused on reducing friction in real workflows.",
2525
image: "/assets/getautoma.png",
26-
github: "https://github.com/adoniscodes/GetAutomaApp",
26+
github: "https://github.com/GetAutomaApp",
2727
website: "https://getautoma.app",
2828
),
2929
Project(
File renamed without changes.

fly.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# fly.toml app configuration file generated for simonferns-com on 2026-01-10T12:46:46+02:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'simonferns-com'
7+
primary_region = 'jnb'
8+
9+
[build]
10+
11+
[http_service]
12+
internal_port = 80
13+
force_https = true
14+
auto_stop_machines = 'stop'
15+
auto_start_machines = true
16+
min_machines_running = 0
17+
processes = ['app']
18+
19+
[[vm]]
20+
size = 'shared-cpu-1x'

index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>Swift WASM Demo</title>
8-
<link rel="stylesheet" href="styles.css">
7+
<title>simonferns.com</title>
8+
<link rel="stylesheet" href="assets/styles.css">
9+
<link rel="icon" type="image/png" href="/assets/getautoma.png">
910
</head>
1011

1112
<body>
@@ -19,4 +20,4 @@
1920
</script>
2021
</body>
2122

22-
</html>
23+
</html>

nginx.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
server {
2+
listen 80;
3+
server_name localhost;
4+
5+
location / {
6+
root /usr/share/nginx/html;
7+
try_files $uri $uri/ /index.html; # Ensure that all routes go through index.html
8+
}
9+
10+
}

0 commit comments

Comments
 (0)