Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add auto build & push docker images by github actions #122

Merged
merged 2 commits into from
Jun 2, 2022
Merged

feat: add auto build & push docker images by github actions #122

merged 2 commits into from
Jun 2, 2022

Conversation

skyoct
Copy link
Contributor

@skyoct skyoct commented May 27, 2022

需要配置secrets DOCKER_USERNAME、DOCKER_PASSWORD
#120

@maslow
Copy link
Member

maslow commented May 27, 2022

COOL! 还要调整一下,就是我们需要在 tag v0.x.x 的时候,才需要 build image, 另外我写的那个 builder 好像还有 bug,它好像有时会在 还没 build 完成的情况下,就去 push 了(还没确定)。

我想是这块指令可能也需要优化一下,拆分个步骤,会更容易控制一些:

  1. build
  2. push
  3. build --latest
  4. push --latest

@skyoct
Copy link
Contributor Author

skyoct commented May 28, 2022

COOL! 还要调整一下,就是我们需要在 tag v0.x.x 的时候,才需要 build image, 另外我写的那个 builder 好像还有 bug,它好像有时会在 还没 build 完成的情况下,就去 push 了(还没确定)。

我想是这块指令可能也需要优化一下,拆分个步骤,会更容易控制一些:

  1. build
  2. push
  3. build --latest
  4. push --latest

拆分指的是拆分为多个不同workflows文件吗

@maslow
Copy link
Member

maslow commented May 28, 2022

还是在一个里面也可以,你先继续这样调用吧,我们后面直接改 builder 就行。
现在修改为 tag 出发就行

@maslow
Copy link
Member

maslow commented May 28, 2022


name: release
on:
  push:
    tags:
      - v*
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-node@v1
        with:
          node-version: 12
      - run: npm install
      - run: npm run build
      - run: npm test
  publish-npm:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-node@v1
        with:
          node-version: 12
          registry-url: 'https://registry.npmjs.org/'
      - run: npm i
      - run: npm publish
        env:
          NODE_AUTH_TOKEN: '${{secrets.npm_token}}'

类似这个触发条件

@maslow maslow merged commit fe313b3 into labring:main Jun 2, 2022
@skyoct skyoct deleted the feat/actions branch June 3, 2022 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants