Skip to content

refactor(configuration): Update server configuration file handling an… #13

refactor(configuration): Update server configuration file handling an…

refactor(configuration): Update server configuration file handling an… #13

name: Docker Hub
permissions:
contents: read
on:
push:
branches:
- main
tags:
- 'v*'
env:
DOCKERHUB_IMAGE: chisdealhdyt/vnyan-server-docker
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Determine version
id: version
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
else
VERSION=latest
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build and push Docker image (multi-arch)
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64
tags: |
docker.io/${{ env.DOCKERHUB_IMAGE }}:${{ env.VERSION }}
docker.io/${{ env.DOCKERHUB_IMAGE }}:latest
build-args: |
VNYAN_VERSION=${{ env.VERSION }}