2021-06-01 13:11:48 +02:00
|
|
|
name: Theme Validation and deployment
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- develop
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-06-01 14:16:31 +02:00
|
|
|
|
|
|
|
- name: Set up Node.js
|
|
|
|
uses: actions/setup-node@v1.2.0
|
|
|
|
with:
|
|
|
|
node-version: '15'
|
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
|
|
|
|
|
|
|
- name: install deps
|
|
|
|
run: npm ci
|
|
|
|
|
|
|
|
- name: create generated dir
|
|
|
|
run: mkdir ./assets/generated
|
|
|
|
|
|
|
|
- name: create stub themes
|
|
|
|
run: "echo '{\"layers\": [], \"themes\": []}' > ./assets/generated/known_layers_and_themes.json"
|
|
|
|
|
|
|
|
- name: Prepare deploy
|
|
|
|
run: npm run prepare-deploy
|
2021-06-01 13:11:48 +02:00
|
|
|
|
|
|
|
- name: Clone deployment repo
|
2021-06-01 14:06:12 +02:00
|
|
|
env:
|
|
|
|
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
|
2021-06-01 13:11:48 +02:00
|
|
|
run: |
|
|
|
|
echo "Cloning destination repo"
|
2021-06-01 14:03:35 +02:00
|
|
|
git config --global user.email "pietervdvn@posteo.net"
|
2021-06-01 13:11:48 +02:00
|
|
|
git config --global user.name "MapComplete"
|
2021-06-01 13:53:08 +02:00
|
|
|
git clone --single-branch --branch main "https://x-access-token:$DEPLOY_KEY@github.com/MapComplete/mapcomplete.github.io.git"
|
2021-06-01 13:11:48 +02:00
|
|
|
echo "Destination repo is cloned"
|
2021-06-01 13:26:51 +02:00
|
|
|
|
|
|
|
- name: "Copying files"
|
|
|
|
run: |
|
|
|
|
echo "Deploying"
|
2021-06-01 14:16:31 +02:00
|
|
|
rm -rf mapcomplete.github.io/*
|
|
|
|
cp dist/* mapcomplete.github.io/
|
2021-06-01 13:43:09 +02:00
|
|
|
cd mapcomplete.github.io/
|
2021-06-01 13:35:31 +02:00
|
|
|
echo "mapcomplete.osm.be" > CNAME
|
2021-06-01 13:46:04 +02:00
|
|
|
git add *
|
2021-06-01 13:26:51 +02:00
|
|
|
git commit -am "Deploying a new version"
|
|
|
|
git push
|