2023-09-01 13:41:57 +02:00
name : Deploy master on mapcomplete.org
2021-06-01 13:11:48 +02:00
on :
push :
branches :
- master
2021-09-09 00:05:51 +02:00
2021-06-01 13:11:48 +02:00
jobs :
build :
runs-on : ubuntu-latest
steps :
2023-09-01 13:41:57 +02:00
- uses : actions/checkout@v3
2021-09-09 00:05:51 +02:00
2023-06-23 22:59:56 +02:00
- name : Set up Node.js
uses : actions/setup-node@v3
with :
2024-05-02 15:44:14 +02:00
node-version : "20"
2023-06-23 22:59:56 +02:00
cache : "npm"
cache-dependency-path : package-lock.json
- name : install deps
run : npm ci
shell : bash
- name : create generated dir
run : mkdir ./assets/generated
shell : bash
- name : create dependencies
run : npm run generate:licenses; npm run generate:images; npm run generate:charging-stations; npm run generate:service-worker; npm run generate:editor-layer-index
shell : bash
- name : sync translations
run : npm run generate:translations
shell : bash
- name : generate layeroverview
run : npm run reset:layeroverview
shell : bash
- name : run tests
run : npm run test
shell : bash
- name : Prepare deploy
run : npm run prepare-deploy
shell : bash
2021-09-09 00:05:51 +02:00
2021-06-01 13:11:48 +02:00
- name : Clone deployment repo
2021-06-01 14:06:12 +02:00
env :
2023-06-23 22:59:56 +02:00
DEPLOY_KEY_PIETERVDVN : ${{ secrets.DEPLOY_KEY_PIETERVDVN }}
2021-09-09 00:05:51 +02:00
run : |
2021-06-01 13:11:48 +02:00
echo "Cloning destination repo"
2021-06-01 14:03:35 +02:00
git config --global user.email "pietervdvn@posteo.net"
2023-06-23 22:59:56 +02:00
git config --global user.name "pietervdvn"
2023-06-24 00:24:30 +02:00
git clone --depth 1 --single-branch --branch main "https://x-access-token:$DEPLOY_KEY_PIETERVDVN@github.com/MapComplete/mapcomplete.github.io.git"
2021-06-01 13:11:48 +02:00
echo "Destination repo is cloned"
2021-09-09 00:05:51 +02:00
2023-06-23 22:59:56 +02:00
- name : Sync repo
env :
DEPLOY_KEY_PIETERVDVN : ${{ secrets.DEPLOY_KEY_PIETERVDVN }}
run : |
2023-06-24 01:12:32 +02:00
cd mapcomplete.github.io
2023-06-23 22:59:56 +02:00
git pull
2021-06-01 13:26:51 +02:00
- name : "Copying files"
run : |
echo "Deploying"
2023-06-23 22:44:33 +02:00
rm -rf mapcomplete.github.io/*
cp -r dist/* mapcomplete.github.io/
cd mapcomplete.github.io/
2023-08-23 18:04:28 +02:00
echo "mapcomplete.org" > CNAME
2023-09-01 13:41:57 +02:00
touch .nojekyll
2021-06-01 13:46:04 +02:00
git add *
2021-06-01 14:53:16 +02:00
if git status | grep -q "Changes to be committed"
then
2023-06-23 22:59:56 +02:00
git commit -am "Deploying a new version of mapcomplete"
2021-06-01 14:53:16 +02:00
git push
else
echo "No changes to commit"
fi