Skip to content

Commit

Permalink
ci: auto upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
fuqihao.foliet committed Dec 21, 2023
1 parent c57c69d commit 92e41e4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
push:
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
branches: [ "*" ]
branches: [ "main" ]
pull_request:
branches: [ "main" ]

Expand All @@ -18,7 +18,7 @@ env:
REGISTRY: docker.io
USERNAME: xhpolaris
# github.repository as <account>/<repo>
IMAGE_NAME: xhpolaris/meowchat-core-api
IMAGE_NAME: meowchat-core-api

jobs:
build:
Expand All @@ -35,6 +35,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup jq
uses: dcarbone/install-jq-action@v2

- name: Bump Version
id: version
run: curl -s https://raw.githubusercontent.com/xh-polaris/chore/main/bump_version.sh | bash -s -- ${{ env.USERNAME }}/${{ env.IMAGE_NAME }}

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
Expand All @@ -55,7 +62,7 @@ jobs:
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ env.USERNAME }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
Expand All @@ -64,7 +71,7 @@ jobs:
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
tags: ${{ env.REGISTRY }}/${{ env.USERNAME }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

0 comments on commit 92e41e4

Please sign in to comment.