This commit is contained in:
@@ -1,10 +1,15 @@
|
|||||||
|
# docker-build.yaml
|
||||||
|
|
||||||
name: Docker Build
|
name: Docker Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "**"
|
- "**"
|
||||||
|
tags:
|
||||||
|
- "**"
|
||||||
pull_request:
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
@@ -17,22 +22,42 @@ jobs:
|
|||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Extract tag name
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
run: echo "GIT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Log in to registry
|
- name: Log in to registry
|
||||||
if: env.REGISTRY != '' && env.REGISTRY_USER != '' && env.REGISTRY_PASSWORD != ''
|
if: secrets.REGISTRY != '' && secrets.REGISTRY_USER != '' && secrets.REGISTRY_PASSWORD != ''
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ secrets.REGISTRY }}
|
||||||
username: ${{ env.REGISTRY_USER }}
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
password: ${{ env.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Check if SHA image exists
|
||||||
|
if: env.GIT_TAG != '' && secrets.REGISTRY != ''
|
||||||
|
id: check_image
|
||||||
|
run: |
|
||||||
|
if docker manifest inspect ${{ secrets.REGISTRY }}5mdt/vitrify-me:${{ github.sha }} > /dev/null 2>&1; then
|
||||||
|
echo "image_exists=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "image_exists=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Pull existing image
|
||||||
|
if: env.GIT_TAG != '' && steps.check_image.outputs.image_exists == 'true'
|
||||||
|
run: docker pull ${{ secrets.REGISTRY }}5mdt/vitrify-me:${{ github.sha }}
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
if: env.GIT_TAG == '' || steps.check_image.outputs.image_exists == 'false'
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: ${{ env.REGISTRY != '' }}
|
push: ${{ secrets.REGISTRY != '' }}
|
||||||
tags: ${{ env.REGISTRY }}5mdt/vitrify-me:${{ github.sha }}
|
tags: ${{ secrets.REGISTRY }}5mdt/vitrify-me:${{ github.sha }}
|
||||||
|
|
||||||
env:
|
- name: Tag and push with git tag
|
||||||
REGISTRY: ${{ secrets.REGISTRY }}
|
if: env.GIT_TAG != '' && secrets.REGISTRY != ''
|
||||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
run: |
|
||||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
docker tag ${{ secrets.REGISTRY }}5mdt/vitrify-me:${{ github.sha }} ${{ secrets.REGISTRY }}5mdt/vitrify-me:${{ env.GIT_TAG }}
|
||||||
|
docker push ${{ secrets.REGISTRY }}5mdt/vitrify-me:${{ env.GIT_TAG }}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# .pre-commit-config.yaml
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.5.0
|
rev: v4.5.0
|
||||||
|
|||||||
2
pnpm-lock.yaml
generated
2
pnpm-lock.yaml
generated
@@ -1,3 +1,5 @@
|
|||||||
|
# pnpm-lock.yaml
|
||||||
|
|
||||||
lockfileVersion: '9.0'
|
lockfileVersion: '9.0'
|
||||||
|
|
||||||
settings:
|
settings:
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# pnpm-workspace.yaml
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
- "apps/*"
|
- "apps/*"
|
||||||
- "packages/*"
|
- "packages/*"
|
||||||
|
|||||||
Reference in New Issue
Block a user