GithubHelp home page GithubHelp logo

github-actions-demo's Introduction

Github-actions-demo

Create action file

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"

appleboy/scp-action

on

Event trigger

// single event
on: push

// Multiple events
on: [push,pull_request]

run-on

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

job

Integration of multiple actions

steps

Each job consists of multiple step, which are executed from top to bottom.

uses

Use the action directly in the market.

Run

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

Add Secret environment variables

Use in yaml file:

password: ${{ secrets.PASSWORD }}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.