mirror of
https://codeberg.org/MarkusThielker/finances.git
synced 2025-07-01 11:09:18 +00:00
Initial commit
This commit is contained in:
commit
52aed24a96
48 changed files with 6980 additions and 0 deletions
44
.github/workflows/docker-image-build-and-push.yaml
vendored
Normal file
44
.github/workflows/docker-image-build-and-push.yaml
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
name: Docker Image Build and Push
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: [ "v*.*.*" ]
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get version from package.json
|
||||
id: versions
|
||||
run: |
|
||||
package_version=$(cat package.json | jq -r '.version')
|
||||
tag_version=$(echo $GITHUB_REF | cut -d '/' -f 3) # Extract tag from ref (e.g., refs/tags/v1.2.3)
|
||||
echo "package_version=v$package_version" >> $GITHUB_OUTPUT
|
||||
echo "tag_version=$tag_version" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Check if versions match
|
||||
if: ${{ steps.versions.outputs.package_version != steps.versions.outputs.tag_version }}
|
||||
run: |
|
||||
echo "Error: Tag version and package.json version do not match!"
|
||||
exit 1 # Stop the workflow
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64
|
||||
tags: markusthielker/next-base:latest, markusthielker/next-base:${{ steps.versions.outputs.tag_version }}
|
Loading…
Add table
Add a link
Reference in a new issue