Skip to content

Commit

Permalink
feat: Merge main tag branch to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
bococ committed Oct 18, 2023
1 parent d0d422c commit 7af6319
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 85 deletions.
40 changes: 35 additions & 5 deletions .github/workflows/tags.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# 定义工作流的名称
name: Build and Push Docker Image
name: CI

on:
workflow_dispatch: # 允许手动触发工作流
push: # 当有代码推送事件发生时
branches:
- main # 只有推送到 main 分支时才触发
tags:
- '*'
pull_request:


# 定义工作流的任务
jobs:
Expand All @@ -28,7 +32,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- run: |
export VERSION=$GITHUB_REF_NAME
make docker-build
linting:
Expand All @@ -51,8 +54,8 @@ jobs:
LINTER_RULES_PATH: /
MARKDOWN_CONFIG_FILE: .markdownlint.yml

deploy:
if: github.event_name == 'push' && github.repository == 'zncdata-labs/spark-k8s-operator'
main:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'bococ/redis-operator'
runs-on: ubuntu-latest
needs:
- build
Expand All @@ -74,7 +77,34 @@ jobs:

- name: Build and push Docker image
run: |
export VERSION=$GITHUB_REF_NAME
make docker-buildx
make bundle
make bundle-buildx
tags:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'bococ/redis-operator'
runs-on: ubuntu-latest
needs:
- build
- linting

steps:
# 检出代码。只检出最新的1次提交
- uses: actions/checkout@v3
with:
fetch-depth: 1

# 登录到 QUAY Hub
- name: Login to quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }} # 使用存储在 GitHub Secrets 中的 QUAY 用户名
password: ${{ secrets.QUAY_PASSWORD }} # 使用存储在 GitHub Secrets 中的 QUAY 密码

- name: Build and push Docker image
run: |
export VERSION=$GITHUB_REF_NAME
make docker-buildx
make bundle
make bundle-buildx
80 changes: 0 additions & 80 deletions .github/workflows/main.yml

This file was deleted.

0 comments on commit 7af6319

Please sign in to comment.