Github Actions All In One
Github Actions All In One

https://github.com/features/actions
https://github.com/marketplace?type=actions
https://docs.github.com/en/developers/github-marketplace
.github/workflows/main.yml
# 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.
on & jobs
zh-Hans
# This is a basic workflow to help you get started with Actions
name: CI
# 控制 action 何时运行
# 在 push 或 pull 请求时触发工作流程事件,但仅针对 master 分支
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# 一个 workflow 运行由可以串行或并行运行的一个或多个 jobs 组成
jobs:
# 此工作流程仅包含一个名为 "build" 的 job
build:
# job 将运行的 runner 类型(执行的系统环境 Linux/ macOS / Windows)
runs-on: ubuntu-latest
# 步骤表示将作为 job 一部分执行的一系列 tasks
steps:
# 在 $GITHUB_WORKSPACE下检出你的repository,以便你的 job 可以访问它
- uses: actions/checkout@v2
# 使用 runners shell 运行单个命令
- name: Run a one-line script
run: echo 正在执行单个命令!
# 使用 runners shell 运行一组命令
- name: Run a multi-line script
run: |
echo 正在执行多个命令的 lint
echo 正在执行多个命令的 test
echo 正在执行多个命令的 build
echo 正在执行多个命令的 deploy
echo 正在执行多个命令的 npm publish
demos
.github/workflows/zh-Hans.yml
# This is a basic workflow to help you get started with Actions
name: DevOps
# 控制 action 何时运行
# 在 push 或 pull 请求时触发工作流程事件,但仅针对 master 分支
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# 一个 workflow 运行由可以串行或并行运行的一个或多个 jobs 组成
jobs:
# 此工作流程仅包含一个名为 "build" 的 job
build:
# job 将运行的 runner 类型(执行的系统环境 Linux/ macOS / Windows)
runs-on: ubuntu-latest
# 步骤表示将作为 job 一部分执行的一系列 tasks
steps:
# 在 $GITHUB_WORKSPACE下检出你的repository,以便你的 job 可以访问它
- uses: actions/checkout@v2
# 使用 runners shell 运行单个命令
- name: Run a one-line script
Github Actions All In One的更多相关文章
- GitHub Actions 完成CI CD
在之前我的部署.版本控制.CI.CD都是在Jenkins 下来完成的 在前几天看到github上的一个新玩具actions,简直惊为天人 它能在你的仓库触发事件(Push,Pull,issue,... ...
- GitHub Actions 工作流
今天打开github上面的 项目 突然 一个github actions 的提示, 进去后显示: 由于项目是Maven 创建的 选择Maven 进入: 初步看到代码: 大概意思就是 我们push ...
- Github原生CI/CD,初尝Github Actions
Github 原生 CI/CD,初尝 Github Actions Intro Github 目前已经推出了自己的 CICD 服务 -- Github Actions,而且比微软的 Azure Dev ...
- Github Actions教程:运行python代码并Push到远端仓库
我自己做了一个网站,这个网站会使用一个python脚本来生成. 具体生成的方法是python脚本会读取目录下的csv文件,将每一行数据解析成固定格式,然后生成html文件,最后需要将修改后的文件自动p ...
- 使用 GitHub Actions 实现 Hexo 博客自动部署
一.Hexo 相关知识点 静态博客简单,但是发布博文时稍显麻烦,一般需要下面两步: hexo clean hexo g -d // 相当于 hexo g + hexo d 如果考虑到同步源文件,还需要 ...
- vuepress-theme-reco + Github Actions 构建静态博客,部署到第三方服务器
最新博客链接 Github链接 查看此文档前应先了解,vuepress基本操作 参考官方文档进行配置: vuepress-theme-reco VuePress SamKirkland / FTP-D ...
- Hexo+GitHub Actions 完美打造个人博客
Hexo简介 Hexo是一款基于Node.js的静态博客框架,依赖少易于安装使用,可以方便的生成静态网页托管在GitHub和Coding上,是搭建博客的首选框架.大家可以进入hexo官网进行详细查看, ...
- Github Actions简单部署一个vue/react项目
大体介绍 本文对github actions部署前端项目做一个简单的总结,总体来说,我感觉用它想要部署一个前端项目,可以说非常简单,简单得令人震惊
- 使用 JS 开发 Github Actions 实现自动部署前后台项目到自己服务器
不想看前面这么多废话的可以直接跳到具体实现 Github Actions 是什么? 说到 Github Actions 不得不提一下. 持续集成(continuous integration):高质量 ...
- 使用 Github Actions 自动部署 Angular 应用到 Github Pages
前言 最近在学习 Angular,一些基础的语法也学习的差不多了,就在 github 上新建了一个代码仓库,准备用 ng-zorro 搭个后台应用的模板,方便自己以后写些小东西时可以直接使用.前端项目 ...
随机推荐
- owners
community/owners.md at master · kubernetes/community https://github.com/kubernetes/community/blob/ma ...
- 如何让淘宝不卡顿? 读写比例 动态扩容 分布式化路线 mysql 优化
作为数据库核心成员,如何让淘宝不卡顿? https://mp.weixin.qq.com/s/l-qXV8NI6ywnUvp3S6an3g
- 服务发现 ap cp 强一致性 最终一致性 dns vip ip
为什么基于域名 08 | 服务发现:到底是要CP还是AP? https://time.geekbang.org/column/article/208171 为什么需要服务发现?先举个例子,假如你要给一 ...
- 解决windows git乱码问题
在windows中打开git bash git config --global i18n.commitencoding utf-8 设置提交日志使用utf-8 git config --g ...
- Spring Boot使用MongoDB GridFS进行文件的操作
1. GridFS简介 GridFS 用于存储和恢复那些超过16M(BSON文件限制)的文件(如:图片.音频.视频等),但是它是存储在MonoDB的集合中. GridFS 会将文件对象分割成多个的ch ...
- sentry 错误监控 报警
错误监控 报警 Sentry | Error Tracking Software - JavaScript, Python, PHP, Ruby, more https://sentry.io/wel ...
- Excel 快速填充:填充柄+数据验证
鼠标左键拖拽填充或者双击填充 右键拖拽填充: 可以填充等比数列.工作日等等 数据验证: 通过下拉箭头快速选择数据: 选择单元格区域-[数据]-[数据验证]-序列 数据科学交流群,群号:18915878 ...
- 封装验证blue事件插件
(function ($) { $.fn.checkForm = function (options) { var root = this; //将当前应用对象存入root var isok = fa ...
- Effective Java读书笔记--对所有对象都通用的方法
1.覆盖equals请遵守通用规定.不需要覆写equals的场景:a.类的每个实例都是唯一的.b.类不需要提供"逻辑相等"的测试功能.c.超类已经覆盖了equals的方法.d.类是 ...
- linux 一分钟搭建zookeeper linux 单机版(亲测可用)
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gzt ...