Skip to content

Image Release

Image Release #3

Workflow file for this run

name: Image Release
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "v*.*.*"
permissions:
contents: read
jobs:
docker-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Determine image tag
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ] || [ "${{ github.ref }}" == "refs/heads/main" ]; then
echo "TAG=latest" >> $GITHUB_ENV
else
echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push frontend image
uses: docker/build-push-action@v5
with:
context: .
file: ./deployment/build/frontend/Dockerfile
push: true
tags: volcanosh/vc-dashboard-frontend:${{ env.TAG }}
platforms: linux/amd64,linux/arm64
- name: Build and push backend image
uses: docker/build-push-action@v5
with:
context: .
file: ./deployment/build/backend/Dockerfile
push: true
tags: volcanosh/vc-dashboard-backend:${{ env.TAG }}
platforms: linux/amd64,linux/arm64
- name: Logout from Docker Hub
if: always()
run: docker logout