Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
update: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yuantuo666 committed Nov 24, 2023
1 parent 23d9a03 commit 49787d2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: Build Docker Image & Pack Source Code

on:
push:
branches:
- 'build:*'
# e.g. build:4.0.0
tags:
- 'v*'

env:
IMAGE_NAME: baiduwp-php
Expand All @@ -17,8 +16,8 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Parse version from branch name
run: echo "VERSION=$(echo $GITHUB_REF | sed -n 's/refs\/heads\/build:\(.*\)/\1/p')" >> $GITHUB_ENV
- name: Parse version from tag name
run: echo "VERSION=$(echo $GITHUB_REF | sed -n 's/refs\/tags\/v\(.*\)/\1/p')" >> $GITHUB_ENV

- name: Build Docker image
run: docker build . --file Dockerfile --tag ${{ env.IMAGE_NAME }}
Expand Down Expand Up @@ -54,7 +53,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
release_name: Release v${{ env.VERSION }}
draft: true
prerelease: false

Expand Down

0 comments on commit 49787d2

Please sign in to comment.