mapcomplete/.github/workflows/deploy_pietervdvn.yml

63 lines
1.8 KiB
YAML
Raw Normal View History

2021-06-02 00:03:37 +02:00
name: Deployment on pietervdvn
on:
push
2021-06-02 00:03:37 +02:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2021-06-02 00:03:37 +02:00
- name: Set up Node.js
uses: actions/setup-node@v1.2.0
with:
node-version: '16'
2021-06-02 00:03:37 +02:00
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
2021-06-02 00:03:37 +02:00
- name: install deps
run: npm ci
2021-06-02 00:03:37 +02:00
- name: create generated dir
run: mkdir ./assets/generated
- name: create stub themes
run: "echo '{\"layers\": [], \"themes\": []}' > ./assets/generated/known_layers_and_themes.json"
2021-06-02 00:03:37 +02:00
- name: Prepare deploy
run: npm run prepare-deploy
2021-06-02 00:03:37 +02:00
- name: Clone deployment repo
env:
2021-06-02 00:53:18 +02:00
DEPLOY_KEY_PIETERVDVN: ${{ secrets.DEPLOY_KEY_PIETERVDVN }}
run: |
2021-06-02 00:03:37 +02:00
echo "Cloning destination repo"
git config --global user.email "pietervdvn@posteo.net"
2021-06-02 00:44:26 +02:00
git config --global user.name "pietervdvn"
2021-06-02 00:10:51 +02:00
git clone --depth 1 --single-branch --branch master "https://x-access-token:$DEPLOY_KEY_PIETERVDVN@github.com/pietervdvn/pietervdvn.github.io.git"
2021-06-02 00:03:37 +02:00
echo "Destination repo is cloned"
2021-11-04 22:22:26 +01:00
- name: Sync repo
env:
DEPLOY_KEY_PIETERVDVN: ${{ secrets.DEPLOY_KEY_PIETERVDVN }}
run: |
cd pietervdvn.github.io
git pull
2021-06-02 00:03:37 +02:00
- name: "Copying files"
run: |
echo "Deploying"
2021-06-02 00:25:52 +02:00
TARGET=${GITHUB_REF:11}
rm -rf pietervdvn.github.io/mc/$TARGET/*
2021-06-02 00:18:43 +02:00
mkdir -p pietervdvn.github.io/mc/$TARGET/
cp -r dist/* pietervdvn.github.io/mc/$TARGET/
2021-06-02 00:31:14 +02:00
cd pietervdvn.github.io/
2021-06-02 00:03:37 +02:00
git add *
if git status | grep -q "Changes to be committed"
then
2021-06-02 00:31:14 +02:00
git commit -am "Deploying a new version of mapcomplete"
2021-06-02 00:03:37 +02:00
git push
else
echo "No changes to commit"
fi