gh workflow

This commit is contained in:
typescreep
2025-06-09 15:18:02 +03:00
parent e575c86af4
commit ca465b8658
3 changed files with 70 additions and 21 deletions

40
.github/workflows/docker-build.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: release
on:
push:
branches:
- '*'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
env:
NODE_VERSION: 20.18.1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: benjlevesque/short-sha@v3.0
id: short-sha
with:
length: 8
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile.build
builder: default
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ secrets.DOCKERHUB_USERNAME }}/openapi-ui:${{ github.head_ref || github.ref_name }}-${{ steps.short-sha.outputs.sha }
build-args: |
NODE_VERSION=${{ env.NODE_VERSION }}