Skip to content

Commit

Permalink
refactor(publish-docker): restrict image push to tags only
Browse files Browse the repository at this point in the history
  • Loading branch information
HsiangNianian committed Nov 25, 2024
1 parent 764ca16 commit 5211ab1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Publish Docker image

on:
push:
branches:
- main
- master
# branches:
# - main
# - master
tags:
- 'v*'
workflow_dispatch:
Expand Down Expand Up @@ -36,6 +36,7 @@ jobs:
run: echo "${{ secrets.ACCESS_TOKEN }}" | sudo docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image
if: "startsWith(github.ref, 'refs/tags/')"
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
Expand Down

0 comments on commit 5211ab1

Please sign in to comment.