CI Deploy Dev #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a deploy workflow to test server | |
name: CI Deploy Dev | |
on: | |
workflow_dispatch: | |
jobs: | |
call-workflow-build: | |
uses: townteki/townsquare-client/.github/workflows/build.yml@master | |
deploy-dev: | |
runs-on: ubuntu-latest | |
needs: call-workflow-build | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Git update | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.REMOTE_TEST_HOST }} | |
username: ${{ secrets.REMOTE_TEST_USER }} | |
key: ${{ secrets.TEST_SERVER_SSH_KEY }} | |
script: | | |
cd ${{ secrets.REMOTE_TEST_TARGET }} | |
git fetch | |
git reset --hard origin/development | |
git clean -fd | |
git submodule update --remote | |
- name: Update from PT | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.REMOTE_TEST_HOST }} | |
username: ${{ secrets.REMOTE_TEST_USER }} | |
key: ${{ secrets.TEST_SERVER_SSH_KEY }} | |
script: | | |
cd ${{ secrets.REMOTE_TEST_TARGET }}/../townsquare-ptdt | |
git fetch | |
git reset --hard origin/playtest | |
git clean -fd | |
cp -r server/game/cards/XX-PT ${{ secrets.REMOTE_TEST_TARGET }}/server/game/cards 2>/dev/null || : | |
cp /townsquare-dev/pt-data/public/img/cards/* /townsquare-dev/townsquare/public/img/cards/ | |
cp -r /townsquare-dev/pt-data/townsquare-json-data/* /townsquare-dev/townsquare/townsquare-json-data/ | |
- name: Cleanup | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.REMOTE_TEST_HOST }} | |
username: ${{ secrets.REMOTE_TEST_USER }} | |
key: ${{ secrets.TEST_SERVER_SSH_KEY }} | |
script: | | |
rm -f ${{ secrets.REMOTE_TEST_TARGET }}/public/* || true | |
rm -f ${{ secrets.REMOTE_TEST_TARGET }}/public/img/* || true | |
rm -r ${{ secrets.REMOTE_TEST_TARGET }}/public/fonts || true | |
rm -r ${{ secrets.REMOTE_TEST_TARGET }}/public/sound || true | |
- name: Get built dist | |
uses: actions/download-artifact@v2 | |
with: | |
name: dist | |
path: dist | |
- name: Deploy dist to Server | |
uses: easingthemes/[email protected] | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.TEST_SERVER_SSH_KEY }} | |
ARGS: "-rltgoDzvO" | |
SOURCE: "dist/" | |
REMOTE_HOST: ${{ secrets.REMOTE_TEST_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_TEST_USER }} | |
TARGET: ${{ secrets.REMOTE_TEST_TARGET }}/public | |
EXCLUDE: "/images/cards/, /node_modules/" | |
- name: Deploy assets to Server | |
uses: easingthemes/[email protected] | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.TEST_SERVER_SSH_KEY }} | |
ARGS: "-rltgoDzvO" | |
SOURCE: "assets/" | |
REMOTE_HOST: ${{ secrets.REMOTE_TEST_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_TEST_USER }} | |
TARGET: ${{ secrets.REMOTE_TEST_TARGET }}/public | |
call-server-restart: | |
uses: townteki/townsquare-client/.github/workflows/dev-restart.yml@master | |
secrets: inherit | |
needs: deploy-dev |