Skip to content

release 2.7.0 (previous release 2.6.0) #92

release 2.7.0 (previous release 2.6.0)

release 2.7.0 (previous release 2.6.0) #92

# Bump version with Commitizen
name: Release new version
on:
push:
branches:
- main
jobs:
bump_version:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'Merge')
name: Bump version and log
outputs:
version: ${{ steps.cz.outputs.version }}
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Bump and changelog
id: cz
uses: commitizen-tools/commitizen-action@0.16.1
with:
github_token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Print version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
merge_back_to_dev:
needs: bump_version
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'Merge')
name: Merge back to dev
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
- name: Set Git config
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
- name: Merge master back to dev
run: |
git checkout development
git merge --no-ff main -m "Merge branch 'main' into development"
git push
build_container:
needs: merge_back_to_dev
name: Build container image
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'Merge')
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: main
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./
file: ./docker/web/Dockerfile.web
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/data-lunch-app:stable
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/data-lunch-app:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/data-lunch-app:buildcache,mode=max