Skip to content

Commit

Permalink
Also publish image if not on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
felixschndr committed May 26, 2024
1 parent f260482 commit 7e3d553
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/publish_image.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Deploy Images to GitHub Container Registry

on:
push:
branches:
- main
workflow_dispatch:
on: push

jobs:
push-store-image:
Expand All @@ -21,6 +17,12 @@ jobs:
password: ${{secrets.CONTAINER_REGISTRY_TOKEN}}

- name: "Build Image and Push to Container Registry"
run: |
docker build . --tag ghcr.io/${{github.repository}}:${{github.ref.name}}
docker push ghcr.io/${{github.repository}}:${{github.ref.name}}
- name: "Build Image as latest and Push to Container Registry"
if: github.ref == 'refs/heads/main'
run: |
docker build . --tag ghcr.io/${{github.repository}}:latest
docker push ghcr.io/${{github.repository}}:latest

0 comments on commit 7e3d553

Please sign in to comment.