Skip to content
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/build_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build and Push latest image
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ github.repository }}:latest
41 changes: 41 additions & 0 deletions .github/workflows/build_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Push Release Docker Images
on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
build:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract version parts
id: extract_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
MAJOR_MINOR_PATCH=$(echo "$VERSION" | awk -F '-' '{print $1}')
MAJOR_MINOR=$(echo "$MAJOR_MINOR_PATCH" | awk -F '.' '{print $1"."$2}')
MAJOR=$(echo "$MAJOR_MINOR_PATCH" | awk -F '.' '{print $1}')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "MAJOR_MINOR_PATCH=$MAJOR_MINOR_PATCH" >> $GITHUB_ENV
echo "MAJOR_MINOR=$MAJOR_MINOR" >> $GITHUB_ENV
echo "MAJOR=$MAJOR" >> $GITHUB_ENV
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ github.repository }}:${{ env.MAJOR_MINOR_PATCH }}
${{ github.repository }}:release-${{ env.MAJOR_MINOR }}
${{ github.repository }}:${{ env.MAJOR }}-latest