Skip to content

Commit 3d65143

Browse files
authored
Fix silly mistake with CD and secrets (#24)
* Fix silly mistake with CD and secrets * test better env delivery * skip staging for now * Add old mapdb URL to the UI
1 parent daf537a commit 3d65143

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

.github/workflows/cd.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ jobs:
5959
strategy:
6060
matrix:
6161
include:
62-
- environment: staging
63-
branch: staging
64-
target_path: "~/staging.mapdb.cncnet.org"
65-
compose_file: "docker-compose.prod.yml"
66-
nginx_conf: "docker/nginx.prod.conf"
67-
host: ${{ secrets.STAGING_SSH_HOST }}
62+
# - environment: staging
63+
# branch: staging
64+
# target_path: "~/staging.mapdb.cncnet.org"
65+
# compose_file: "docker-compose.prod.yml"
66+
# nginx_conf: "docker/nginx.prod.conf"
67+
# host-s-name: "STAGING_SSH_HOST"
6868
- environment: production
6969
branch: main
7070
target_path: "~/mapdb.cncnet.org"
7171
compose_file: "docker-compose.prod.yml"
7272
nginx_conf: "docker/nginx.prod.conf"
73-
host: ${{ secrets.PROD_SSH_HOST }}
73+
host-s-name: "PROD_SSH_HOST"
7474

7575
steps:
7676
- name: "Exit if not matching branch"
@@ -83,7 +83,7 @@ jobs:
8383
- name: Copy docker-compose and nginx config over ssh
8484
uses: appleboy/scp-action@v0.1.7
8585
with:
86-
host: ${{ matrix.host }}
86+
host: ${{ secrets[matrix.host-s-name] }}
8787
username: ${{ secrets.SSH_USER }}
8888
key: ${{ secrets.SSH_PRIVATE_KEY }}
8989
source: "${{ matrix.compose_file }},${{ matrix.nginx_conf }}"
@@ -92,14 +92,12 @@ jobs:
9292
- name: SSH into server and deploy
9393
uses: appleboy/ssh-action@v1.2.1
9494
with:
95-
host: ${{ matrix.host }}
95+
host: ${{ secrets[matrix.host-s-name] }}
9696
username: ${{ secrets.SSH_USER }}
9797
key: ${{ secrets.SSH_PRIVATE_KEY }}
9898
script: |
9999
cd ${{ matrix.target_path }}
100100
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
101-
envstr='${{ secrets.PROD_ENV_FILE }}'
102-
echo -e $envstr > .env
103101
docker compose -f ${{ matrix.compose_file }} pull
104102
docker compose -f ${{ matrix.compose_file }} down
105103
docker compose -f ${{ matrix.compose_file }} up -d

kirovy/templates/legacy_outer.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<div class="navbar">
2424
<a href="/search" title="CnCNet Legacy Map Search">Search</a>
2525
<a href="/upload-manual" title="CnCNet Legacy Map Upload">Upload</a>
26+
<a href="https://legacydb.cncnet.org">Old Map DB</a>
2627
</div>
2728
<h1>{% block header_text %}404{% endblock %}</h1>
2829
</div>

0 commit comments

Comments
 (0)