This repository has been archived by the owner on Mar 31, 2024. It is now read-only.
generated from workadventure/map-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (55 loc) · 2.13 KB
/
buildanddeploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: build page and deploy page and maps
on:
push:
branches: [ main, hierkommtdiemaus, hiergehtdiemaus ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Optimize map
uses: thecodingmachine/map-optimizer-action@master
- if: github.event_name == 'push' && github.ref_name == 'main'
name: build jekyll page for production
run: |
bundle config path vendor/bundle
bundle install
bundle exec jekyll build
- if: github.event_name == 'push' && github.ref_name != 'main'
name: build jekyll page for preview
run: |
bundle config path vendor/bundle
bundle install
bundle exec jekyll build -b "/${{ github.ref_name }}"
- name: upload to production
if: github.event_name == 'push' && github.ref_name == 'main'
env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
run: |
eval "$(ssh-agent -s)"
ssh-add - <<< "${SSH_KEY}"
mkdir ~/.ssh
ssh-keyscan -H ${SSH_HOST} >> ~/.ssh/known_hosts
scp -r _site/* ${SSH_USER}@${SSH_HOST}:/world.naturkunde.museum/
- name: upload to preview
if: github.event_name == 'push' && github.ref_name != 'main'
env:
SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USER: ${{ secrets.SSH_USER }}
run: |
eval "$(ssh-agent -s)"
ssh-add - <<< "${SSH_KEY}"
mkdir ~/.ssh
ssh-keyscan -H ${SSH_HOST} >> ~/.ssh/known_hosts
scp -r _site/* ${SSH_USER}@${SSH_HOST}:/world.naturkunde.museum/${{ github.ref_name }}