V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
xinmans
V2EX  ›  Kubernetes

github actioins 和 gitea actions 有没有比较好的例子参考,比如我要 build 一个 docker image 并发布到 k8s 里

  •  
  •   xinmans · 190 天前 via iPhone · 1175 次点击
    这是一个创建于 190 天前的主题,其中的信息可能已经有所发展或是发生改变。
    网上资源不多啊
    7 条回复    2023-10-20 13:41:48 +08:00
    zhixiao
        1
    zhixiao  
       190 天前
    好巧,我刚好在看 gitea action 发布镜像倒 gitea 自身的软件包里,应该也可以看看,反正 github 和 gitea action 基本是兼容的:

    ```
    name: Build test image
    run-name: ${{ github.actor }} is testing out Gitea Actions
    on:
    push:
    tags:
    - v*

    jobs:
    build:
    runs-on: ubuntu-latest
    steps:

    - name: Checkout
    uses: actions/checkout@v3

    - name: Login to gitea
    uses: docker/login-action@v3
    with:
    registry: example.com
    username: test
    password: password
    - name: Build and push
    uses: docker/build-push-action@v5
    with:
    push: true
    tags: example.com/test/test-image:${{github.ref_name}}
    ```
    Morii
        2
    Morii  
       190 天前
    我刚才问了下 GPT-4, 结果就不贴了,看了下基本符合你的要求
    l4ever
        3
    l4ever  
       190 天前
    gitea actions 完全兼容 github.
    rbe
        4
    rbe  
       190 天前
    https://docs.github.com/zh/actions/examples/using-scripts-to-test-your-code-on-a-runner

    官方文档有简中翻译版的。
    为啥会觉得网上资源不多?随便点进一些热门开源项目,大概率有 .github 目录,点进去里面都是可以照着抄的例子。
    xinmans
        5
    xinmans  
    OP
       190 天前 via iPhone
    @rbe 好方法
    xinmans
        6
    xinmans  
    OP
       190 天前 via iPhone
    @zhixiao thanks
    qloog
        7
    qloog  
       190 天前
    有一个部署到 aws 的 EKS(k8s)服务的, 基于 Golang 版本,可供参考:
    https://github.com/go-eagle/eagle/blob/master/.github/workflows/deploy.yml
    镜像服务也是在 aws 上。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   864 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:16 · PVG 04:16 · LAX 13:16 · JFK 16:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.