From d279ccc874fc1cf84ce5148c250de75d78f9fc0c Mon Sep 17 00:00:00 2001 From: Benno Lin Date: Thu, 2 Jul 2020 22:44:49 +0800 Subject: [PATCH] create cd flow --- .github/workflows/cd.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000000000..0ba8fefe359eb --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,35 @@ +name: Dog Food +on: + push: + branches: + - dogfood +jobs: + build: + name: Deploy Dog Food + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install SSH key + uses: JimCronqvist/action-ssh@master + with: + hosts: supercoder@dev-forum-2.nexf.org + privateKey: ${{ secrets.SSH_KEY_OF_NEXFORUM }} + command: | + sudo su + cd /var/discourse + git reset --hard + git clean -f + git remote add upstream https://github.com/nexfoundation/discourse_docker.git + git fetch upstream nexforum + branch=$(git branch | grep "nexforum") + if [ "$branch" = "* nexforum" ] + then + git pull + elif [ "$branch" = " nexforum" ] + then + git checkout nexforum + else + git checkout -b nexforum upstream/nexforum + fi + ./launcher rebuild app