Skip to content

chore: version packages #47

chore: version packages

chore: version packages #47

Workflow file for this run

name: Docker Release
on:
push:
tags:
- 'bulkitdev-**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get image info from tag
id: get_info
run: |
TAG=${GITHUB_REF#refs/tags/}
IMAGE_NAME=$(echo $TAG | cut -d'/' -f1)
VERSION=$(echo $TAG | cut -d'/' -f2)
VERSION=${VERSION#v}
# Check if this is a next release
if [[ "$VERSION" == *"next"* ]]; then
echo "is_next=true" >> $GITHUB_OUTPUT
else
echo "is_next=false" >> $GITHUB_OUTPUT
fi
echo "image=questpie/$IMAGE_NAME" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Generate Docker tags
id: docker_tags
run: |
TAGS="${{ steps.get_info.outputs.image }}:${{ steps.get_info.outputs.version }}"
if [[ "${{ steps.get_info.outputs.is_next }}" == "false" ]]; then
TAGS="$TAGS,${{ steps.get_info.outputs.image }}:latest"
fi
echo "tags=$TAGS" >> $GITHUB_OUTPUT
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
file: docker/${{ contains(steps.get_info.outputs.image, '-worker') && 'worker' || contains(steps.get_info.outputs.image, '-api') && 'api' || 'app' }}.Dockerfile
push: true
tags: ${{ steps.docker_tags.outputs.tags }}
platforms: linux/amd64,linux/arm64