Skip to content

Commit

Permalink
ci: fix release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
fearlessfe committed Jan 16, 2025
1 parent bff7d9f commit 785cbfd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: shisui release image

on:
release:
types: [created]
push:
tags:
- v*

defaults:
run:
Expand All @@ -16,16 +17,13 @@ permissions:
contents: write

env:
releaseBuild: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
REGISTRY: ghcr.io
TAG_NAME: ${{ github.ref | replace('refs/tags/', '') }}

jobs:
push_image_to_github:
name: Push Docker image to Github
runs-on: ubuntu-latest
permissions: write-all
if: ${{ env.releaseBuild == 'true' }} # Only run this job if releaseBuild is true
steps:
- name: Check out the repo
uses: actions/checkout@v4
Expand All @@ -42,4 +40,4 @@ jobs:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ env.TAG_NAME }}
tags: ${{ env.REGISTRY }}/${{ github.repository }}:${{ github.ref }}

0 comments on commit 785cbfd

Please sign in to comment.