Skip to content

Commit

Permalink
Merge pull request #3137 from huridocs/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
konzz authored Aug 28, 2020
2 parents 1fcc270 + 7b058b2 commit e66f963
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 'master'
- name: Use Node.js 14.6.x
uses: actions/setup-node@v1
with:
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/deploy_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy release

on:
push:
branches:
- release

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 'release'
- name: Use Node.js 14.6.x
uses: actions/setup-node@v1
with:
node-version: '14.6.x'
- name: Cache node modules
uses: actions/cache@v1.1.2
with:
path: ./node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: install dependencies
run: yarn install
- name: Cache build
id: cache-build
uses: actions/cache@v2
with:
path: ./prod
key: ${{ runner.os }}-build-${{ hashFiles('app/**/*.*') }}-${{ hashFiles('database/**/*.*') }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/run.js') }}-${{ hashFiles('**/server.js') }}
- name: build production
if: steps.cache-build.outputs.cache-hit != 'true'
run: yarn production-build
- name: Tgz production build
run: tar -czf uwazi_release_${GITHUB_SHA}.tgz ./prod
- name: Copy to server
uses: easingthemes/ssh-deploy@v2.1.1
env:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }}
ARGS: "-rltgoDzvO --delete"
SOURCE: uwazi_release_${GITHUB_SHA}.tgz
REMOTE_HOST: ${{ secrets.DEPLOY_SERVER }}
REMOTE_USER: ${{ secrets.DEPLOY_USER }}
TARGET: uwazi_release_${GITHUB_SHA}.tgz
- name: Overwrite latest
uses: easingthemes/ssh-deploy@v2.1.1
env:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }}
ARGS: "-rltgoDzvO --delete"
SOURCE: uwazi_release_${GITHUB_SHA}.tgz
REMOTE_HOST: ${{ secrets.DEPLOY_SERVER }}
REMOTE_USER: ${{ secrets.DEPLOY_USER }}
TARGET: uwazi_release_latest.tgz

0 comments on commit e66f963

Please sign in to comment.