2021-06-01 13:11:48 +02:00
|
|
|
name: Theme Validation and deployment
|
|
|
|
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:
|
|
|
|
- uses: actions/checkout@v2
|
2021-09-09 00:05:51 +02:00
|
|
|
|
2022-01-12 21:36:41 +01:00
|
|
|
- name: Setup and validate themes
|
|
|
|
uses: ./.github/actions/setup-and-validate
|
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:
|
|
|
|
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
|
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"
|
2021-06-01 13:11:48 +02:00
|
|
|
git config --global user.name "MapComplete"
|
2021-06-01 14:46:27 +02:00
|
|
|
git clone --depth 1 --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-09-09 00:05:51 +02:00
|
|
|
|
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/*
|
2021-06-01 14:37:44 +02:00
|
|
|
cp -r 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 14:53:16 +02:00
|
|
|
if git status | grep -q "Changes to be committed"
|
|
|
|
then
|
|
|
|
git commit -am "Deploying a new version"
|
|
|
|
git push
|
|
|
|
else
|
|
|
|
echo "No changes to commit"
|
|
|
|
fi
|