Giter VIP home page Giter VIP logo

actionsflow's Introduction

Actions flow

认识到 Github Actions 的强大和便捷后,忍不住要搞一些小轮子(小动作)。

Secrets - 基础

Github: GITHUB_TOKEN

If you choose github_token, this token is auto created when workflow launches. No extra operation is needed.

Github: PERSONAL_TOKEN

Secret name: PERSONAL_TOKEN

Secret value: <token>

Actions

站在巨人的肩膀上到底有多香,期待不如行动。

Action: Sync GitHub to Gitee

Github 仓库每一次提交后,通过 Github Action 自动将仓库同步到 Gitee 上。

点击上代码 sync2gitee.yml

步骤:

  • 在个人 Github 需要同步的仓库上添加 3 个 secrets: (Setting -> Secrets -> New repository secret)

    • GITEE_USER,比如个人的 Gitee user: steper
    • GITEE_PRIVATE_KEY,获取方法(如果已有,直接设置) - Gitee公钥对应的私钥 新建 private key 方法:
    • GITEE_TOKEN,获取方法 - Gitee对应的用于创建仓库的token 新建 token 方法:
      • 点击上面的链接并登录 Gitee, 点击“生成新令牌”,
      • 添加描述,比如用处 - Github 仓库同步到 Gitee;
      • 权限默认全选,点击提交,显示出生成的 token 值;(注意保存,需要填到 Github 的 secrets 中)
  • 在 Github 仓库上提交改动(如修改 README.md),查看 Github Actions 的运行,并到 Gitee 上对应仓库验证是否同步成功。

示例:

Github 仓库 Action gyx8899/blog Gitee 仓库 steper/blog

Action: gitbook publish to gh-pages

Publish Gitbook · Actions · GitHub Marketplace

官方介绍非常详细,直接收录。

发现的技巧

  • on push 状态下,过滤不必要的改动提交,如提交信息中包含[build]的时候才执行 Action,示例如下
jobs:
  format:
    runs-on: ubuntu-latest
    if: "contains(github.event.head_commit.message, '[build]')"

  # 取反的情况
  # if: "! contains(github.event.head_commit.message, 'wip')"

参考文档

actionsflow's People

Contributors

gyx8899 avatar neu-kate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.