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

Commit

Permalink
Add support only pushing to github with specific tag
Browse files Browse the repository at this point in the history
Signed-off-by: Aisuko <[email protected]>
  • Loading branch information
Aisuko committed Mar 18, 2024
1 parent 3d235ec commit cf3d332
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: 'Rebel CI/CD 🚀'
on:
workflow_dispatch:
push:
Expand All @@ -15,6 +15,7 @@ on:

jobs:
build:
name: 'Build 🏗️'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -37,13 +38,14 @@ jobs:
# run: npm ci

docker_build:
name: 'Docker Build 🐳'
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Login to Github Container Registry
uses: docker/login-action@v3
# if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -52,8 +54,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/') != true && success()
run: |
docker build -t ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::7} .
docker push ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::7}
- name: Push Docker image
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
run: |
docker push ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::7}
docker push ghcr.io/${{ secrets.NAMESPACE }}/${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//}

0 comments on commit cf3d332

Please sign in to comment.