-
Notifications
You must be signed in to change notification settings - Fork 196
41 lines (32 loc) · 1.17 KB
/
push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Push workflow
on:
push:
branches:
- main
jobs:
release-version:
name: Releasing a version
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'chore') || (github.ref_name == 'main' && !contains(github.event.head_commit.message, 'chore(release)')) }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.USER_TOKEN }}
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Install node_modules
run: yarn
- name: Authenticate with GitHub
run: |
git config --global user.name "${{ secrets.USER_NAME }}"
git config --global user.email "${{ secrets.USER_EMAIL }}"
- name: Generate Site
run: yarn generate
- name: Copy .htaccess
run: cp .htaccess ./public_html
- name: Zip artifacts
run: zip -r ${{ steps.get-release-data.outputs.file }}.zip package.json CHANGELOG.md
- name: scp upload to production site
run: sshpass -p ${{ secrets.PROD_PASS }} scp -o 'StrictHostKeyChecking no' -r public_html/ ${{ secrets.PROD_USER }}@${{ secrets.PROD_IP }}:~/