GitHub Actions in Action

https://lab.github.com/githubtraining/github-actions:-hello-world

https://github.com/xgqfrms/hello-github-actions/issues/1

https://github.com/xgqfrms/hello-github-actions/issues/3

https://github.com/xgqfrms/webpack-plugin/actions/new

https://github.com/xgqfrms/webpack-plugin/new/master?filename=.github%2Fworkflows%2Fmain.yml&workflow_template=blank


# This is a basic workflow to help you get started with Actions name: CI # Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ] # A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2 # Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world! # Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.

https://github.com/xgqfrms/webpack-plugin/new/master?filename=.github%2Fworkflows%2Fnodejs.yml&workflow_template=nodejs

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Node.js CI on:
push:
branches: [ master ]
pull_request:
branches: [ master ] jobs:
build: runs-on: ubuntu-latest strategy:
matrix:
node-version: [10.x, 12.x] steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test

https://github.com/xgqfrms/webpack-plugin/new/master?filename=.github%2Fworkflows%2Fnpmpublish.yml&workflow_template=npmpublish


# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages name: Node.js Package on:
release:
types: [created] jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci
- run: npm test publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}} publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

https://github.com/xgqfrms/webpack-plugin/new/master?filename=.github%2Fworkflows%2Fgreetings.yml&workflow_template=greetings

name: Greetings

on: [pull_request, issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: 'Message that will be displayed on users'' first issue'
pr-message: 'Message that will be displayed on users'' first pr'

https://github.com/xgqfrms/webpack-plugin/new/master?filename=.github%2Fworkflows%2Flabel.yml&workflow_template=label

# This workflow will triage pull requests and apply a label based on the
# paths that are modified in the pull request.
#
# To use this workflow, you will need to set up a .github/labeler.yml
# file with configuration. For more information, see:
# https://github.com/actions/labeler/blob/master/README.md name: Labeler
on: [pull_request] jobs:
label: runs-on: ubuntu-latest steps:
- uses: actions/labeler@v2
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

https://github.com/xgqfrms/webpack-plugin/new/master?filename=.github%2Fworkflows%2Fstale.yml&workflow_template=stale

name: Mark stale issues and pull requests

on:
schedule:
- cron: "0 0 * * *" jobs:
stale: runs-on: ubuntu-latest steps:
- uses: actions/stale@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'

demo

https://github.com/xgqfrms/webpack-plugin/runs/639001801?check_suite_focus=true

githib action

https://github.com/actions

https://github.com/actions/virtual-environments/

https://github.com/actions/typescript-action

https://github.com/actions/javascript-action

.github/workflows

  1. main.yml
name: A workflow for my Hello World file
on: push jobs:
build:
name: Hello world action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ./action-a
with:
MY_NAME: "Mona"

action

  1. Dockerfile

https://github.com/xgqfrms/hello-github-actions/new/xgqfrms-patch-1?filename=action-a/Dockerfile

FROM debian:9.5-slim

ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
  1. action.yml

https://github.com/xgqfrms/hello-github-actions/new/xgqfrms-patch-1?filename=action-a/action.yml


name: "Hello Actions"
description: "Greet someone"
author: "octocat@github.com" inputs:
MY_NAME:
description: "Who to greet"
required: true
default: "World" runs:
using: "docker"
image: "Dockerfile" branding:
icon: "mic"
color: "purple"
  1. entrypoint.sh

https://github.com/xgqfrms/hello-github-actions/new/xgqfrms-patch-1?filename=action-a/entrypoint.sh

#!/bin/sh -l

sh -c "echo Hello world my name is $INPUT_MY_NAME"

demo

https://github.com/xgqfrms/hello-github-actions/tree/master/action-a

https://github.com/xgqfrms/hello-github-actions/actions

create file by URL

https://github.com/xgqfrms/repo-name/new/master?filename=src/folder_name/filename

refs



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


最新文章

  1. gd库
  2. springboot Serving Web Content with Spring MVC
  3. 简述 C、C++程序编译的内存分配情况【转】
  4. [MFC] 梳理一个简单的图片处理桌面软件中用到的MFC控件技巧
  5. css通用小笔记02——浮动、清除(三个例子)
  6. PHP各种缓存
  7. dw websites
  8. hdu1078 记忆化搜索
  9. Apache查看并发及TIME_WAIT过多的解决
  10. Map的基本用法(Java)
  11. 线程——QQ邮件发送
  12. Linux/RedHat 编译安装GNU gcc 4.9.0 (g++)
  13. android 安装包签名问题探究
  14. hdu 4731
  15. Linux下使用多线程模拟异步网络通信
  16. [置顶] 创建GitHub技术博客全攻略
  17. grep -v grep 代表在查询的最终结果中去掉grep命令本身
  18. 应用之间进行跳转,ComponentName的方式
  19. Python 中的继承、多态和封装
  20. ie 9.10 兼容性问题 遇到的坑

热门文章

  1. 试玩 GOWOG ,初探 OpenAI(使用 NeuroEvolution 神经进化)与 Golang 多人在线游戏开发
  2. 详解SpringMVC
  3. 匿名字段 内嵌结构体 interface作为struct field 匿名接口
  4. windows IOCP 实践
  5. 从输入URL到页面展示,这中间都发生了什么?
  6. Flutter环境搭建遇坑小结(二)
  7. Box Model 盒子模型
  8. linux 用户、用户组及相关命令(useradd 、passwd、userdel 、groupadd 、groupdel、usermod 、gpasswd 、 id、su)
  9. Docker下使用centos无法使用systemctl怎么办
  10. AYIT-2020 609暑假集训第一周周赛题 A - A计划