Skip to content

Commit 4bb8c87

Browse files
committed
2 parents a2bd2e2 + 20ed877 commit 4bb8c87

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Deploy to Fly.io
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout main
14+
uses: actions/checkout@v4
15+
with:
16+
ref: main
17+
fetch-depth: 0
18+
19+
- name: Set up Git
20+
run: |
21+
git config user.name "github-actions[bot]"
22+
git config user.email "github-actions[bot]@users.noreply.github.com"
23+
24+
- name: Fetch deployment branch
25+
run: git fetch origin deployment:deployment
26+
27+
- name: Attempt merge and resolve package conflicts
28+
id: merge_attempt
29+
run: |
30+
git checkout deployment
31+
# Attempt merge
32+
if ! git merge origin/main --no-edit; then
33+
# If merge fails due to package conflicts, reset and reinstall
34+
echo "MERGE_FAILED=true" >> $GITHUB_ENV
35+
exit 0
36+
fi
37+
38+
# After successful merge, ensure package consistency
39+
echo "Ensuring package consistency..."
40+
rm -rf node_modules/ package-lock.json
41+
npm install
42+
git add package-lock.json
43+
git commit -m "Update package-lock.json after merge" || echo "No package-lock changes"
44+
45+
- name: Push to deployment branch
46+
if: env.MERGE_FAILED != 'true'
47+
run: |
48+
git push origin deployment
49+
50+
- name: Set up Node.js
51+
if: env.MERGE_FAILED != 'true'
52+
uses: actions/setup-node@v3
53+
with:
54+
node-version: '22'
55+
cache: 'npm'
56+
57+
- name: Install dependencies
58+
if: env.MERGE_FAILED != 'true'
59+
run: |
60+
npm ci # Uses package-lock.json for exact versions
61+
62+
- name: Deploy to Fly.io
63+
if: env.MERGE_FAILED != 'true'
64+
uses: superfly/flyctl-actions@1.4
65+
with:
66+
args: deploy --remote-only
67+
env:
68+
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ The Atenean Freedom Map is an interactive web application that allows users to e
33

44

55
<h3 align="center">
6-
🗺️ Try it out here: <a href="https://admu-freedom-map.fly.dev/">Atenean Freedom Map </a> 🗺️
6+
🗺️ Try it out here: <a href="https://freedom-map.uxsociety.org/">Atenean Freedom Map </a> 🗺️
77
</h3>
88

99

0 commit comments

Comments
 (0)