Skip to content

Commit 2cf78b6

Browse files
committed
fix contact email and automate landing deploy
1 parent 23bd033 commit 2cf78b6

3 files changed

Lines changed: 38 additions & 6 deletions

File tree

.github/workflows/container.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ name: Publish Container
33
on:
44
push:
55
branches:
6-
- expansion
6+
- main
77
workflow_dispatch:
88

9+
concurrency:
10+
group: landing-production
11+
cancel-in-progress: false
12+
913
permissions:
1014
contents: read
1115
packages: write
@@ -41,9 +45,10 @@ jobs:
4145
tags: |
4246
type=ref,event=branch
4347
type=sha,prefix=sha-
44-
type=raw,value=latest,enable=${{ github.ref_name == 'expansion' }}
48+
type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
4549
4650
- name: Build and push image
51+
id: build
4752
uses: docker/build-push-action@v7
4853
with:
4954
context: .
@@ -53,3 +58,30 @@ jobs:
5358
labels: ${{ steps.meta.outputs.labels }}
5459
cache-from: type=gha
5560
cache-to: type=gha,mode=max
61+
62+
- name: Configure restricted deployment key
63+
env:
64+
VPS_DEPLOY_KEY: ${{ secrets.VPS_DEPLOY_KEY }}
65+
VPS_HOST_KEY: ${{ secrets.VPS_HOST_KEY }}
66+
run: |
67+
install -d -m 0700 ~/.ssh
68+
printf '%s\n' "$VPS_DEPLOY_KEY" > ~/.ssh/landing_deploy
69+
printf '%s\n' "$VPS_HOST_KEY" > ~/.ssh/known_hosts
70+
chmod 0600 ~/.ssh/landing_deploy ~/.ssh/known_hosts
71+
72+
- name: Deploy landing only
73+
env:
74+
IMAGE_DIGEST: ${{ steps.build.outputs.digest }}
75+
VPS_HOST: ${{ secrets.VPS_HOST }}
76+
VPS_USER: ${{ secrets.VPS_USER }}
77+
run: |
78+
started_ms=$(date +%s%3N)
79+
image="ghcr.io/${GITHUB_REPOSITORY}@${IMAGE_DIGEST}"
80+
printf 'TIMING deploy_request_started_at=%s\n' "$(date --iso-8601=milliseconds)"
81+
ssh \
82+
-i ~/.ssh/landing_deploy \
83+
-o BatchMode=yes \
84+
-o IdentitiesOnly=yes \
85+
"${VPS_USER}@${VPS_HOST}" \
86+
"deploy-landing ${image} ${GITHUB_SHA} ${GITHUB_RUN_ID}"
87+
printf 'TIMING deploy_request_ms=%s\n' "$(( $(date +%s%3N) - started_ms ))"

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ docker compose logs -f
5050
docker compose down
5151
```
5252

53-
On every push to `expansion`, GitHub Actions publishes:
53+
On every push to `main`, GitHub Actions publishes:
5454

5555
```text
56-
ghcr.io/rgs2151/landing:expansion
56+
ghcr.io/rgs2151/landing:main
5757
ghcr.io/rgs2151/landing:latest
5858
ghcr.io/rgs2151/landing:sha-<commit>
5959
```
@@ -63,7 +63,7 @@ A server/infrastructure repository should pull the image instead of copying this
6363
```yaml
6464
services:
6565
landing:
66-
image: ghcr.io/rgs2151/landing:expansion
66+
image: ghcr.io/rgs2151/landing:main
6767
restart: unless-stopped
6868
expose:
6969
- "80"

src/main.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function LandingPage() {
1919
I build models to understand the brain.
2020
</p>
2121
<p className="contact-block text-center">
22-
<span>rgs2151@columbia.eu</span>
22+
<span>rgs2151@columbia.edu</span>
2323
<a href="https://github.com/rgs2151" target="_blank" rel="noopener noreferrer">github.com/rgs2151</a>
2424
</p>
2525
</td>

0 commit comments

Comments
 (0)