forked from MapComplete/MapComplete
Add deployment of branches
This commit is contained in:
parent
f86e8ea191
commit
9bdfb76126
1 changed files with 53 additions and 0 deletions
53
.github/workflows/deploy_pietervdvn.yml
vendored
Normal file
53
.github/workflows/deploy_pietervdvn.yml
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
name: Deployment on pietervdvn
|
||||
on:
|
||||
push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- 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
|
||||
|
||||
- name: Clone deployment repo
|
||||
env:
|
||||
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY_PIETERVDVN }}
|
||||
run: |
|
||||
echo "Cloning destination repo"
|
||||
git config --global user.email "pietervdvn@posteo.net"
|
||||
git config --global user.name "MapComplete"
|
||||
git clone --depth 1 --single-branch --branch main "https://x-access-token:$DEPLOY_KEY_PIETERVDVN@github.com/pietervdvn/pietervdvn.github.io.git"
|
||||
echo "Destination repo is cloned"
|
||||
|
||||
- name: "Copying files"
|
||||
run: |
|
||||
echo "Deploying"
|
||||
rm -rf pietervdvn.github.io/mc/$GITHUB_REF/*
|
||||
cp -r dist/* pietervdvn.github.io/mc/$GITHUB_REF/
|
||||
cd mapcomplete.github.io/
|
||||
git add *
|
||||
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
|
Loading…
Reference in a new issue