Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI scripts for uploading #25

Merged
merged 1 commit into from
Feb 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/npm-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ jobs:
with:
node-version: 12
registry-url: https://registry.npmjs.org/

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- run: yarn && yarn compile && npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
12 changes: 12 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,16 @@ jobs:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- run: yarn && yarn compile
41 changes: 41 additions & 0 deletions .github/workflows/upload.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Upload Assets

on:
push: {}

jobs:
upload-assets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v1

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn && yarn release
name: Build web assets

- name: Deploy to server
id: deploy
uses: Pendect/action-rsyncer@v1.1.0
env:
DEPLOY_KEY: ${{secrets.rsync_private_key}}
with:
flags: "-avzr --progress"
options: ""
ssh_options: ""
src: "dist/*"
dest: "rsync-user@fe.jimu.io:/web-assets/repo/${{ github.repository }}"

- name: Display status from deploy
run: echo "${{ steps.deploy.outputs.status }}"