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 发布文章使用:只允许注册用户才可以访问!


GitHub Actions in Action的更多相关文章

  1. GitHub Actions 工作流

    今天打开github上面的 项目 突然 一个github actions 的提示, 进去后显示: 由于项目是Maven 创建的 选择Maven 进入:  初步看到代码:  大概意思就是 我们push ...

  2. Github原生CI/CD,初尝Github Actions

    Github 原生 CI/CD,初尝 Github Actions Intro Github 目前已经推出了自己的 CICD 服务 -- Github Actions,而且比微软的 Azure Dev ...

  3. Github Actions教程:运行python代码并Push到远端仓库

    我自己做了一个网站,这个网站会使用一个python脚本来生成. 具体生成的方法是python脚本会读取目录下的csv文件,将每一行数据解析成固定格式,然后生成html文件,最后需要将修改后的文件自动p ...

  4. 使用 GitHub Actions 实现 Hexo 博客自动部署

    一.Hexo 相关知识点 静态博客简单,但是发布博文时稍显麻烦,一般需要下面两步: hexo clean hexo g -d // 相当于 hexo g + hexo d 如果考虑到同步源文件,还需要 ...

  5. vuepress-theme-reco + Github Actions 构建静态博客,部署到第三方服务器

    最新博客链接 Github链接 查看此文档前应先了解,vuepress基本操作 参考官方文档进行配置: vuepress-theme-reco VuePress SamKirkland / FTP-D ...

  6. Hexo+GitHub Actions 完美打造个人博客

    Hexo简介 Hexo是一款基于Node.js的静态博客框架,依赖少易于安装使用,可以方便的生成静态网页托管在GitHub和Coding上,是搭建博客的首选框架.大家可以进入hexo官网进行详细查看, ...

  7. Github Actions简单部署一个vue/react项目

    大体介绍 本文对github actions部署前端项目做一个简单的总结,总体来说,我感觉用它想要部署一个前端项目,可以说非常简单,简单得令人震惊

  8. 使用 JS 开发 Github Actions 实现自动部署前后台项目到自己服务器

    不想看前面这么多废话的可以直接跳到具体实现 Github Actions 是什么? 说到 Github Actions 不得不提一下. 持续集成(continuous integration):高质量 ...

  9. 使用 Github Actions 自动部署 Angular 应用到 Github Pages

    前言 最近在学习 Angular,一些基础的语法也学习的差不多了,就在 github 上新建了一个代码仓库,准备用 ng-zorro 搭个后台应用的模板,方便自己以后写些小东西时可以直接使用.前端项目 ...

随机推荐

  1. ROS教程(一):ROS安装教程(详细图文)

    ros教程:ros安装 目录 前言 一.版本选择 二.开始安装 2.1 软件中心配置 2.2 添加源 2.3 安装 三.验证ROS 前言 关于ROS(Robot OS 机器人操作系统),估计看这个教程 ...

  2. dotnet cli 5.0 新特性——dotnet tool search

    dotnet cli 5.0 新特性--dotnet tool search Intro .NET 5.0 SDK 的发布,给 dotnet cli 引入了一个新的特性,dotnet tool sea ...

  3. join 查询优化

    在开发中往往会出现查询多表联查的情况,那么就会用到 join 查询. Join查询种类 为了方便说明,先定义一个统一的表,下面再做例子. CREATE TABLE `t2` ( `id` int(11 ...

  4. MySQL之谓词下推

    MySQL之谓词下推 什么是谓词 在SQL中,谓词就是返回boolean值即true或者false的函数,或是隐式转换为boolean的函数.SQL中的谓词主要有 LKIE.BETWEEN.IS NU ...

  5. windows10 中 svn 代码统计工具 StatSVN 使用详解

    1.下载TortoiseSVN 下载地址 ps:安装时务必选上命令行的svn命令. 2.下载StatSVN 官网地址 官网上目前时0.7.0版本,我的svn是1.12.0版本,运行时会报错: 所以建议 ...

  6. 阿里云服务器centos7,docker部署mysql+Redis+vue+springboot+Nginx+fastdfs,亲测可用

    一.购买云服务器 我是今年双十一期间在阿里云购买的服务器, 简单配置2核_4G_40G_3M,三年用了不到800块,不过当时我记得腾讯云更便宜,个人感觉,阿里的云服务器更加的稳定, 毕竟身经百战, 经 ...

  7. DP中的树上边/点覆盖问题

    目录 树上边覆盖问题 例:luoguP2016 战略游戏 简述题意: Solution: Code 树上点覆盖问题 简述题意 Solution Code: 树上边覆盖问题 例:luoguP2016 战 ...

  8. CF 板刷总结

    CF 板刷总结 这件事的开始要从万圣节那一天说起.当然,万圣节只用于描述时间,我显然是不参加任何万圣节活动的对吧. 以下是一些我觉得有必要拿出来讲的,有技术含量的题.会持续更新,断更了记得来催更. C ...

  9. 分布式缓存 — MongoDB

    --- 数据库管理系统 数据库管理系统主要分为俩大类:RDBMS.NOSQL.在个人电脑.大型计算机和主机上应用最广泛的数据库管理系统是关系型DBMS.NoSQL是对不同于传统的关系数据库的数据库管理 ...

  10. (G)I-DLE—화(火花) (HWAA)

    闲来无事又来推歌了/cy 我这博客好像只能用来更日记+推歌了/kk 到今天(G)I-DLE已经获得九个一位啦~ 歌真的挺不错的 特别是,一个韩国女团出了这首歌的中文版 就觉得很有好感 music 韩文 ...