Skip to content

v1.0 to v1.1

v1.0 to v1.1 #54

Workflow file for this run

name: Docker Image Build and Deploy
on:
push:
tags:
- 'v[0-9]+.[0-9]+.0'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ vars.NODE_VERSION }}
- name: Build Server UI
run: |
cd ./server-ui
npm i --omit=dev
npm run build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Metadata Capture
id: meta
uses: docker/metadata-action@v5
with:
context: git
images: |
${{ vars.REGISTRY }}/${{ github.repository }}
${{ github.repository }}
tags: |
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ${{ vars.DOCKERFILE_PROD }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
"org.opencontainers.image.description=${{ vars.GHCR_DESCRIPTION }}"
provenance: false
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ github.repository }}
short-description: ${{ vars.DOCKER_HUB_DESCRIPTION }}
readme-filepath: ${{ vars.README_FILE_PATH }}