Skip to content

Commit d6bf8de

Browse files
committed
ci: set up local politigraph for staging build
1 parent fe2dd65 commit d6bf8de

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

.github/workflows/production.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
uses: burnett01/[email protected]
1717
with:
1818
remote_host: ${{ secrets.PRODUCTION_HOST }}
19-
remote_user: ${{ secrets.PRODUCTION_USER }}
20-
remote_key: ${{ secrets.PRODUCTION_KEY }}
19+
remote_user: bot
20+
remote_key: ${{ secrets.SSH_KEY }}
2121
remote_path: ${{ secrets.PRODUCTION_PATH }}
2222
switches: -avzr --omit-dir-times --no-owner --no-group --no-perms --delete
2323
path: ./

.github/workflows/staging.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ jobs:
1919
ARTIFACT=build-${ARTIFACT/\//-}
2020
echo "ARTIFACT=${ARTIFACT}" >> $GITHUB_ENV
2121
echo "Set artifact name as ${ARTIFACT}"
22-
- uses: actions/checkout@v4
23-
- name: Use Node.js
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
- name: Setup Node.js
2425
uses: actions/setup-node@v4
2526
with:
2627
node-version: 22
@@ -29,8 +30,28 @@ jobs:
2930
run: yarn install
3031
- name: Test
3132
run: yarn test
32-
- name: Build SvelteKit
33+
- name: Set up rsync
34+
id: rsync
35+
uses: GuillaumeFalourd/[email protected]
36+
with:
37+
ssh_key: ${{ secrets.SSH_KEY }}
38+
- name: Register Politigraph host and key
39+
run: |
40+
mkdir ~/.ssh
41+
ssh-keyscan ${{ secrets.POLITIGRAPH_SSH_HOST }} > ~/.ssh/known_hosts
42+
ssh-add ${{ steps.rsync.outputs.ssh_key_path }}
43+
- name: Pull latest Politigraph snapshot
44+
run: |
45+
rsync -azvP bot@${{ secrets.POLITIGRAPH_SSH_HOST }}:${{ secrets.POLITIGRAPH_SSH_PATH }}/* ./politigraph
46+
docker load --input ./politigraph/politigraph-image.tar.gz
47+
- name: Start Politigraph services
48+
run: cd politigraph && docker compose -f compose.server.yml up -d neo4j nuxt && cd ..
49+
- name: Build static site
3350
run: yarn build
51+
env:
52+
POLITIGRAPH_GRAPHQL_URL: http://localhost:3000/graphql
53+
- name: Stop Politigraph services
54+
run: cd politigraph && docker compose -f compose.server.yml down && cd ..
3455
- name: Build Histoire
3556
continue-on-error: true
3657
run: yarn story:build

0 commit comments

Comments
 (0)