Create actionName.yml file under path .github/workflows/
name: scp files
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: copy file via ssh password
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: 22
source: "./"
target: "/home/ubuntu"
Event trigger
// single event
on: push
// Multiple events
on: [push,pull_request]
operating system Image for building.
Availabletypes are
- ubuntu-latest, ubuntu-18.04, or ubuntu-16.04
- windows-latest or windows-2019
- macos-latest or macos-10.15
Integration of multiple actions
Each job consists of multiple step, which are executed from top to bottom.
Use the action directly in the market.
Start a shell to execute the command.
// single command
- name: Install Dependencies
run: npm install
// Multiple command
- name: Clean install dependencies and build
run: |
npm ci
npm run build
Use in yaml file:
password: ${{ secrets.PASSWORD }}