update #2973
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: world map | |
on: | |
push: | |
workflow_dispatch: | |
repository_dispatch: | |
types: update | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
architecture: "x64" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Update database | |
env: | |
GEO_API_URL: ${{ secrets.GEO_API_URL }} | |
LOCAL_DB_URL: ${{ secrets.LOCAL_DB_URL }} | |
REMOTE_DB_URL: ${{ secrets.REMOTE_DB_URL }} | |
HEADER_KEY: ${{ secrets.HEADER_KEY }} | |
HEADER_LOCAL_KEY: ${{ secrets.HEADER_LOCAL_KEY }} | |
GOOGLE_KEY: ${{ secrets.GOOGLE_KEY }} | |
run: | | |
mkdir data | |
mkdir data/year | |
mkdir data/month | |
python main.py | |
- name: sshagent | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: deploy | |
run: | | |
branch="${GITHUB_REF#refs/heads/}" | |
echo "The branched that was pushed is $branch" | |
mkdir -p ~/.ssh | |
chmod 700 ~/.ssh | |
echo "maps.media.mit.edu ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFqXBJPFe+pH3L57o1ildAxHssG4lpkloTcw3Wbs64c7bL8M6hR0rre4ufpCKboVLn4trJqbKOPWtFgBJHsgqXA=" > ~/.ssh/known_hosts | |
scp ./data/*.js [email protected]:/root/map/data/ | |
scp ./data/year/*.js [email protected]:/root/map/data/ | |
scp ./data/month/*.js [email protected]:/root/map/data/ | |
scp ./web/*.js [email protected]:/root/map/ | |
scp ./web/*.html [email protected]:/root/map/ | |
- name: Upload Result | |
uses: actions/upload-artifact@v3 | |
with: | |
name: result | |
path: data/* |