Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ jobs:
strategy:
matrix:
include:
- environment: staging
branch: staging
target_path: "~/staging.mapdb.cncnet.org"
compose_file: "docker-compose.prod.yml"
nginx_conf: "docker/nginx.prod.conf"
host: ${{ secrets.STAGING_SSH_HOST }}
# - environment: staging
# branch: staging
# target_path: "~/staging.mapdb.cncnet.org"
# compose_file: "docker-compose.prod.yml"
# nginx_conf: "docker/nginx.prod.conf"
# host-s-name: "STAGING_SSH_HOST"
- environment: production
branch: main
target_path: "~/mapdb.cncnet.org"
compose_file: "docker-compose.prod.yml"
nginx_conf: "docker/nginx.prod.conf"
host: ${{ secrets.PROD_SSH_HOST }}
host-s-name: "PROD_SSH_HOST"

steps:
- name: "Exit if not matching branch"
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Copy docker-compose and nginx config over ssh
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ matrix.host }}
host: ${{ secrets[matrix.host-s-name] }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: "${{ matrix.compose_file }},${{ matrix.nginx_conf }}"
Expand All @@ -92,14 +92,12 @@ jobs:
- name: SSH into server and deploy
uses: appleboy/ssh-action@v1.2.1
with:
host: ${{ matrix.host }}
host: ${{ secrets[matrix.host-s-name] }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd ${{ matrix.target_path }}
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
envstr='${{ secrets.PROD_ENV_FILE }}'
echo -e $envstr > .env
docker compose -f ${{ matrix.compose_file }} pull
docker compose -f ${{ matrix.compose_file }} down
docker compose -f ${{ matrix.compose_file }} up -d
1 change: 1 addition & 0 deletions kirovy/templates/legacy_outer.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<div class="navbar">
<a href="/search" title="CnCNet Legacy Map Search">Search</a>
<a href="/upload-manual" title="CnCNet Legacy Map Upload">Upload</a>
<a href="https://legacydb.cncnet.org">Old Map DB</a>
</div>
<h1>{% block header_text %}404{% endblock %}</h1>
</div>
Expand Down