Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 27 additions & 8 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@ jobs:
- sast-code-snyk
- sast-dockerfile-trivy-hadolint
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: fetch-tags
run: git fetch --tags origin
shell: bash
- id: bump-version
uses: armakuni/github-actions/bump-version@main
- name: check-bump-version-output
run: |
echo "version-was-bump: ${{ steps.bump-version.outputs.version-was-bump }}"
echo "previous-version: ${{ steps.bump-version.outputs.previous-version }}"
echo "current-version: ${{ steps.bump-version.outputs.current-version }}"
shell: bash
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand All @@ -145,24 +159,29 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: |
abhisheksr01/companieshouse
images: abhisheksr01/companieshouse
context: git
flavour: |
latest=true
tags: |
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{version}},prefix=v,value=${{ steps.bump-version.outputs.current-version }}
labels: |
"org.opencontainers.image.title": "abhisheksr01/companieshouse",
"org.opencontainers.image.description": "Best practices and integrations available for Spring Boot based Microservice in a single repository with companieshouse API use case.",
"org.opencontainers.image.url": "https://github.com/abhisheksr01/spring-boot-microservice-best-practices",
"org.opencontainers.image.source": "https://github.com/abhisheksr01/spring-boot-microservice-best-practices",
"org.opencontainers.image.version": "0.1.0",
"org.opencontainers.image.version": ${{ steps.bump-version.outputs.current-version }},
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision": ${{ github.sha }},
"org.opencontainers.image.licenses": "MIT"
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: abhisheksr01/companieshouse:latest
push: ${{ github.event_name != 'pull_request' && steps.bump-version.outputs.version-was-bump == 'true' }} # Only push on main branch & when the version is bumped
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
sbom: true
provenance: true

Loading
Loading