Skip to content

Merge pull request #70 from BofAI/ai-bankofai-patch-1 #39

Merge pull request #70 from BofAI/ai-bankofai-patch-1

Merge pull request #70 from BofAI/ai-bankofai-patch-1 #39

name: Release Publish
on:
push:
branches:
- main
env:
IMAGE_NAME: bankofai/docs
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
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
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
- name: Get version from package.json
id: version
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Set Docker tags
id: meta
run: |
echo "tags<<EOF" >> $GITHUB_OUTPUT
echo "${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
APP_ENV=production
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64