Skip to content

Commit

Permalink
update docker workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
baozhoutao committed Mar 14, 2024
1 parent ea98543 commit 4013468
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 17 deletions.
41 changes: 34 additions & 7 deletions .github/workflows/docker-community.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,45 @@ jobs:
matrix:
node-version: [14.x]
steps:
# checkout branch 2.7
# - name: Checkout branch 2.7
# uses: actions/checkout@v2
# if: ${{ startsWith(steps.branch-name.outputs.tag, '2.7') }}
# with:
# ref: '2.7'

- uses: nowsprinting/check-version-format-action@v3
id: version
with:
prefix: 'v'

- name: Check valid tag format
if: steps.version.outputs.is_valid == 'false'
run: exit 1

- name: Get branch names
id: branch-name
uses: tj-actions/[email protected]
with:
strip_tag_prefix: v

- name: Get the current tag
if: steps.branch-name.outputs.is_tag == 'true' # Replaces: startsWith(github.ref, 'refs/tags/')
run: |
echo "tag: ${{ steps.branch-name.outputs.tag }}"
echo "current_branch: ${{ steps.branch-name.outputs.current_branch }}"
echo "ref_branch: ${{ steps.branch-name.outputs.ref_branch }}"
- name: Check valid branch
if: ${{ !startsWith(steps.branch-name.outputs.tag, '2.') }}
run: exit 1

# checkout branch 2.7
- name: Checkout branch 2.7
uses: actions/checkout@v2
if: ${{ startsWith(steps.branch-name.outputs.tag, '2.7') }}
with:
ref: '2.7'

# checkout branch 2.6
- name: Checkout branch 2.6
uses: actions/checkout@v2
if: ${{ startsWith(steps.branch-name.outputs.tag, '2.6') }}
with:
ref: '2.6'

- name: Set Current Version
run: |
Expand Down
44 changes: 34 additions & 10 deletions .github/workflows/docker-enterprise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,45 @@ jobs:
matrix:
node-version: [14.x]
steps:
# - name: Checkout branch 2.7
# uses: actions/checkout@v2
# with:
# ref: '2.7'

- uses: nowsprinting/check-version-format-action@v3
id: version
with:
prefix: 'v'

- name: Check valid tag format
if: steps.version.outputs.is_valid == 'false'
run: exit 1

- name: Get branch names
id: branch-name
uses: tj-actions/[email protected]
with:
strip_tag_prefix: v

- name: Get the current tag
if: steps.branch-name.outputs.is_tag == 'true' # Replaces: startsWith(github.ref, 'refs/tags/')
run: |
echo "tag: ${{ steps.branch-name.outputs.tag }}"
echo "current_branch: ${{ steps.branch-name.outputs.current_branch }}"
echo "ref_branch: ${{ steps.branch-name.outputs.ref_branch }}"
- name: Check valid branch
if: ${{ !startsWith(steps.branch-name.outputs.tag, '2.') }}
run: exit 1

# checkout branch 2.7
- name: Checkout branch 2.7
uses: actions/checkout@v2
if: ${{ startsWith(steps.branch-name.outputs.tag, '2.7') }}
with:
ref: '2.7'

- uses: nowsprinting/check-version-format-action@v3
id: version
with:
prefix: 'v'

# checkout branch 2.6
- name: Checkout branch 2.6
uses: actions/checkout@v2
if: ${{ startsWith(steps.branch-name.outputs.tag, '2.6') }}
with:
ref: '2.6'

- name: Set Current Version
run: |
Expand Down

0 comments on commit 4013468

Please sign in to comment.