Skip to content
This repository was archived by the owner on Aug 21, 2022. It is now read-only.

Commit 87e7134

Browse files
committed
💚 (workflows) deploy in master branch
1 parent 5c52014 commit 87e7134

File tree

10 files changed

+49
-202
lines changed

10 files changed

+49
-202
lines changed

.github/workflows/deploy.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy
33
on:
44
push:
55
branches:
6-
- release
6+
- master
77

88
jobs:
99
deploy:
@@ -16,14 +16,39 @@ jobs:
1616
with:
1717
ruby-version: 2.7
1818

19+
- name: Setup Nodejs
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: '12.x'
23+
24+
- name: Get yarn cache directory path
25+
id: yarn-cache-dir-path
26+
run: echo "::set-output name=dir::$(yarn cache dir)"
27+
28+
- name: Use cached node_modules
29+
uses: actions/cache@v1
30+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
31+
with:
32+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
33+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-yarn-
36+
1937
- name: Increasing the amount of inotify watchers
2038
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
2139

22-
- name: Deploy
40+
- name: Precompile
41+
env:
42+
RAILS_ENV: production
43+
RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }}
2344
run: |
2445
sudo apt-get -yqq install libpq-dev
25-
sudo apt-get install expect
2646
gem install bundler:2.1.4
27-
bundle config path vendor/bundle
2847
bundle install --jobs 4 --retry 3
29-
bin/exp ${{ secrets.PAYIN_SSH_PWD }} bundle exec mina deploy production
48+
yarn install
49+
bin/rails assets:precompile
50+
51+
- name: Deploy
52+
run: |
53+
sudo apt-get install expect
54+
bin/deploy ${{ secrets.PAYIN_SSH_PWD }} bundle exec mina deploy production

.github/workflows/precomile.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
pull_request:
55
branches:
66
- develop
7-
- master
87

98
jobs:
109
test:

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
/config/credentials/development.key
2626

2727
# Ingore development & test packs
28-
/public/packs-dev
29-
/public/packs-test
30-
/public/assets-dev
28+
/public/packs
29+
/public/packs
30+
/public/assets
3131

3232
# test result
3333
/coverage

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Payin
22

3-
![Lint](https://github.com/an-lee/payin/workflows/Lint/badge.svg) ![Test](https://github.com/an-lee/payin/workflows/Test/badge.svg) ![Precompile](https://github.com/an-lee/payin/workflows/Precompile/badge.svg) ![Deploy](https://github.com/an-lee/payin/workflows/Deploy/badge.svg)
3+
![Lint](https://github.com/an-lee/payin/workflows/Lint/badge.svg) ![Test](https://github.com/an-lee/payin/workflows/Test/badge.svg) ![Deploy](https://github.com/an-lee/payin/workflows/Deploy/badge.svg)
44

55
[Payin](https://payin.xin) is a Mixin Messenger Bot providing smooth multi-sign paying experience.
66

app/models/multisig_transaction.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# signer_uuids :uuid default("{}"), is an Array
1414
# status :string
1515
# threshold :integer
16+
# transaction_hash :string
1617
# created_at :datetime not null
1718
# updated_at :datetime not null
1819
# asset_id :uuid
@@ -24,6 +25,7 @@
2425
# index_multisig_transactions_on_multisig_account_id (multisig_account_id)
2526
# index_multisig_transactions_on_receiver_uuids (receiver_uuids)
2627
# index_multisig_transactions_on_sender_uuids (sender_uuids)
28+
# index_multisig_transactions_on_transaction_hash (transaction_hash)
2729
# index_multisig_transactions_on_user_id (user_id)
2830
#
2931
class MultisigTransaction < ApplicationRecord

bin/exp renamed to bin/deploy

File renamed without changes.

config/deploy.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
command %(journalctl -f -u sidekiq)
106106
end
107107

108-
desc 'Precompile locally'
108+
desc 'Rsync precompiled assets from local to remote /temp'
109109
task :rsync_packs_from_local_to_tmp do
110110
run :local do
111111
command %(echo "-----> rsync public/assets to #{fetch(:tmp_path)}/public/assets")
@@ -116,7 +116,7 @@
116116
end
117117
end
118118

119-
desc 'Rsync packs from tmp'
119+
desc 'Rsync packs from /tmp to /current'
120120
task :rsync_from_tmp_to_current do
121121
command %(echo "-----> rsync #{fetch(:tmp_path)}/public/assets/ to #{fetch(:current_path)}/public/assets")
122122
command %(rsync #{fetch(:tmp_path)}/public/assets/ #{fetch(:current_path)}/public/assets/)
@@ -125,7 +125,6 @@
125125
command %(rsync #{fetch(:tmp_path)}/public/packs/ #{fetch(:current_path)}/public/packs/)
126126
end
127127

128-
129128
desc 'Deploys the current version to the server.'
130129
task :deploy do
131130
# uncomment this line to make sure you pushed your local branch to the remote origin

config/webpacker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ default: &default
1111

1212
# Additional paths webpack should lookup modules
1313
# ['app/assets', 'engine/foo/app/assets']
14-
resolved_paths: []
14+
resolved_paths: ['app/assets']
1515

1616
# Reload manifest.json on all requests so we reload latest compiled packs
1717
cache_manifest: false
@@ -59,7 +59,7 @@ development:
5959
check_yarn_integrity: true
6060

6161
# Compile development packs to a separate directory
62-
public_output_path: packs-dev
62+
# public_output_path: packs-dev
6363

6464
# Reference: https://webpack.js.org/configuration/dev-server/
6565
dev_server:

0 commit comments

Comments
 (0)