diff --git a/.github/workflows/main.yml b/.github/workflows/dev.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/dev.yml diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml new file mode 100644 index 00000000..464ce741 --- /dev/null +++ b/.github/workflows/prod.yml @@ -0,0 +1,19 @@ +on: + push: + branches: + - master + +jobs: + deploy_prod: + name: Pull latest master and redeploy prod instance + runs-on: ubuntu-latest + + steps: + - name: SSH live pull and build (same machine so correct host is dev.) + uses: D3rHase/ssh-command-action@v0.2.2 + with: + host: dev.openaccessbutton.org + user: ${{secrets.USER_TEST_V1}} + private_key: ${{secrets.GA_ED25519}} + host_fingerprint: ${{secrets.FINGERPRINT_TEST_V1}} + command: cd ~/live/oaworks/embed && git pull && cd ~/live/openresearchbutton/website && git pull && npm install && node build.js && sudo nginx -s reload diff --git a/content/shareyourpaper/setup.html b/content/shareyourpaper/setup.html index 7b0de091..d2c7950c 100644 --- a/content/shareyourpaper/setup.html +++ b/content/shareyourpaper/setup.html @@ -697,8 +697,10 @@

OAB Only TODO is this still needed

}); var deposits = function(e) { - var addr = api + '/' + ($(this).attr('id') === 'all_file_deposits' ? 'deposited' : 'deposits') + '.csv?uid=' + noddy.user.account._id; - if ($('#depositdate').val()) addr += '&q=deposit.createdAt:>' + new Date($('#depositdate').datepicker('getDate')).valueOf(); + var addr = api + '/deposited.csv?' + if (noddy.user !== undefined && noddy.user.account !== undefined && noddy.user.account._id !== undefined) addr += 'uid=' + noddy.user.account._id + '&'; + if ($(this).attr('id') === 'all_file_deposits') addr += 'submitted=true&'; + if ($('#depositdate').val()) addr += 'fromdate=' + new Date($('#depositdate').datepicker('getDate')).valueOf() + '&'; $(this).attr('href',addr); } $('body').on('click','#all_deposits',deposits); diff --git a/static/triggers.md b/static/triggers.md new file mode 100644 index 00000000..c8c98cdf --- /dev/null +++ b/static/triggers.md @@ -0,0 +1 @@ +I trigger deployments... \ No newline at end of file