Skip to content

Commit

Permalink
Updated workflows #patch
Browse files Browse the repository at this point in the history
  • Loading branch information
jordybronowicki37 committed Oct 24, 2024
1 parent 7baf736 commit e897948
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 44 deletions.
45 changes: 32 additions & 13 deletions .github/workflows/bump-tag.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
name: Bump tag version
on:
push:
branches:
- main
workflow_call:
inputs:
default_bump:
description: The default version bump
required: false
type: string
default: minor
workflow_dispatch:
inputs:
default_bump:
description: The default version bump
required: false
type: string
default: minor
options:
- none
- patch
- minor
- major

jobs:
build:
bump-tag:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
version: ${{ steps.tag.outputs.new_tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Bump version and push tag
uses: anothrNick/github-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: minor
- name: Bump version and push tag
id: tag
uses: anothrNick/github-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: ${{ inputs.default_bump }}
43 changes: 43 additions & 0 deletions .github/workflows/create-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Publish Docker Image

on:
workflow_call:
inputs:
image_name:
description: The image name
required: false
type: string
default: befit
version:
description: The image version
required: true
type: string
workflow_dispatch:
inputs:
image_name:
description: The image name
required: false
type: string
default: befit
version:
description: The image version
required: true
type: string

jobs:
build-and-publish:
runs-on: ubuntu-latest

permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v4
- name: install buildx
uses: docker/setup-buildx-action@v3
- name: Login to Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and push the Docker image
run: docker buildx build --push --platform linux/arm64/v8,linux/amd64 --file Dockerfile --tag ghcr.io/${{ github.actor }}/${{ inputs.image_name }}:${{ inputs.version }} .
working-directory: backend
31 changes: 0 additions & 31 deletions .github/workflows/docker-image.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/feature-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Feature release
on:
push:
branches:
- main

jobs:
bump-tag-version:
permissions:
contents: write
uses: ./.github/workflows/bump-tag.yml
build-and-publish:
needs: bump-tag-version
permissions:
packages: write
contents: read
uses: ./.github/workflows/create-docker-image.yml
with:
version: ${{ needs.bump-tag-version.outputs.version }}

0 comments on commit e897948

Please sign in to comment.