Skip to content
Merged
Changes from 5 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
61 changes: 61 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Docker 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: Get tag or branch name
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "TAG=latest" >> $GITHUB_ENV
else
echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Update tag for main branch
if: github.ref == 'refs/heads/main'
run: |
echo "TAG=latest" >> $GITHUB_ENV

- 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