Merge pull request #4 from anshul7665/anshulss/buildimage

remove comments
This commit is contained in:
Anshul Sharma 2025-04-23 22:01:58 +05:30 committed by GitHub
commit 92af9de733
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,7 +24,6 @@ permissions:
jobs: jobs:
tag_release: tag_release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Removed env: IMAGE_TAG here, it's not used correctly across jobs
outputs: outputs:
# Define output to pass the tag to the next job # Define output to pass the tag to the next job
new_tag: ${{ steps.tag_version.outputs.next_version }} new_tag: ${{ steps.tag_version.outputs.next_version }}
@ -125,7 +124,7 @@ jobs:
git ls-remote --tags origin | grep "refs/tags/${{ steps.tag_version.outputs.next_version }}" || (echo "Tag push verification failed!" && exit 1) git ls-remote --tags origin | grep "refs/tags/${{ steps.tag_version.outputs.next_version }}" || (echo "Tag push verification failed!" && exit 1)
echo "Tag successfully pushed." echo "Tag successfully pushed."
build_and_push_docker_image: # Renamed job slightly for clarity build_and_push_docker_image:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: tag_release # Depends on the tag being created successfully needs: tag_release # Depends on the tag being created successfully
permissions: permissions:
@ -135,8 +134,6 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# No need to checkout specific ref here, use default branch code
# The tag is just metadata for the Docker image version
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
@ -154,7 +151,7 @@ jobs:
with: with:
images: ghcr.io/${{ github.repository_owner }}/surfsense_backend images: ghcr.io/${{ github.repository_owner }}/surfsense_backend
tags: | tags: |
# Use the tag generated in the previous job (FIX) # Use the tag generated in the previous job
type=raw,value=${{ needs.tag_release.outputs.new_tag }} type=raw,value=${{ needs.tag_release.outputs.new_tag }}
# Optionally add 'latest' tag if building from the default branch # Optionally add 'latest' tag if building from the default branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || github.event.inputs.branch == github.event.repository.default_branch }} type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || github.event.inputs.branch == github.event.repository.default_branch }}
@ -164,7 +161,6 @@ jobs:
with: with:
context: ./surfsense_backend context: ./surfsense_backend
push: true push: true
# Use the tags generated by the metadata action (FIX)
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
# Optional: Add build cache for faster builds # Optional: Add build cache for faster builds