Update deploy.yml #49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: auto-deploy | |
on: | |
push: | |
branches: [master] | |
jobs: | |
archive-file: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: get version | |
id: version | |
uses: notiz-dev/github-action-json-property@release | |
with: | |
path: 'library.json' | |
prop_path: 'version' | |
- name: get current time | |
uses: 1466587594/get-current-time@v2 | |
id: current-time | |
with: | |
format: YYYY.MM.DD | |
utcOffset: "+08:00" | |
# - name: install-zip | |
# uses: montudor/action-zip@v1 | |
# - name: Zip output | |
# run: zip -qq -r blinker-library-${{steps.version.outputs.prop}}.zip ../blinker-library -x .github/* -x .git/* | |
# working-directory: ${{ github.workspace }} | |
# - name: Archive Release | |
# uses: thedoctor0/[email protected] | |
# with: | |
# type: 'zip' | |
# filename: 'blinker-library-${{steps.version.outputs.prop}}.zip' | |
# directory: '${{ github.workspace }}' | |
# path: '../' | |
- name: download zip | |
uses: carlosperate/[email protected] | |
with: | |
file-url: 'https://api.github.com/repos/blinker-iot/blinker-library/zipball' | |
file-name: 'blinker-library-${{steps.version.outputs.prop}}.zip' | |
- name: create json | |
id: jsonfile | |
uses: jsdaniell/[email protected] | |
with: | |
name: "arduino.json" | |
json: '{"img": "assets/sdk/arduino.png", "text": "Arduino (C++)", "update": "${{ steps.current-time.outputs.formattedTime}}", "version": "${{steps.version.outputs.prop}}", "github": "https://github.com/blinker-iot/blinker-library", "document": "https://diandeng.tech/doc/arduino-support", "download": "sdk/blinker-library-${{steps.version.outputs.prop}}.zip" }' | |
- name: upload zip | |
uses: garygrossgarten/github-action-scp@release | |
with: | |
local: blinker-library-${{steps.version.outputs.prop}}.zip | |
remote: ${{ secrets.REMOTE_PATH }}/blinker-library-${{steps.version.outputs.prop}}.zip | |
host: ${{ secrets.SERVER_IP }} | |
username: ubuntu | |
password: ${{ secrets.SERVER_PASSWD }} | |
recursive: true | |
- name: upload json | |
uses: garygrossgarten/github-action-scp@release | |
with: | |
local: arduino.json | |
remote: ${{ secrets.REMOTE_PATH }}/arduino.json | |
host: ${{ secrets.SERVER_IP }} | |
username: ubuntu | |
password: ${{ secrets.SERVER_PASSWD }} | |
recursive: true |