From 1dc1ecba2ecd32bad5f432184efbdc4ff7e3bb31 Mon Sep 17 00:00:00 2001 From: Sebastian D <31686237+sebathefox@users.noreply.github.com> Date: Wed, 5 Aug 2020 14:08:59 +0200 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..7521a12 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: CD + +on: + push: + branches: [ production ] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + token: a0a2dd521e6af856629d95da2a32f196957a78b0 + - name: Set up Node + uses: actions/setup-node@v1 + with: + node-version: '12.x' + - run: npm install + - run: npm run production + - name: Commit built assets + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git checkout -B deploy + git add -f public/ + git commit -m "Build front-end assets" + git push -f origin deploy + - name: Deploy to production + uses: appleboy/ssh-action@master + with: + username: ekapp + host: sebathefox.dk + password: Aa123456& + script: 'cd /home/ekapp/public_html/skolehjem && ./server_deploy.sh'