Skip to content

added success stories from product site #117 (#144) #1

added success stories from product site #117 (#144)

added success stories from product site #117 (#144) #1

name: Build and Deploy Staging Docker Images
on:
push:
branches:
- main
paths-ignore:
- '**/README.md'
- '**/CONTRIBUTING.md'
- '**/CONFIGURATION.md'
- '**/.devcontainer/**'
- "**/.github/workflows/**"
jobs:
build-preview:
name: Build Staging Artifacts
environment:
name: preview
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install NodeJS Dependencies
run: npm install
- name: Get Commit Hash
id: commit_hash
uses: prompt/actions-commit-hash@v3
- name: Get Current Date
id: date
run: echo "today=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- name: Build Image Tag
id: build_image_tag
run: echo "image_version=${{ steps.date.outputs.today }}-${{github.run_number}}-${{ steps.commit_hash.outputs.short }}" >> $GITHUB_OUTPUT
- name: Build Container Image Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ vars.REGISTRY }}/${{ vars.REGISTRY_ORG }}/${{ vars.IMG_NAME }}
tags: |
type=raw,value=${{ steps.build_image_tag.outputs.image_version }}
- name: Build App
env:
REACT_APP_VERSION: ${{ steps.build_image_tag.outputs.image_version }}
REACT_APP_DOCS_NEXT_HOST: ${{ vars.DOCS_NEXT_HOST }}
REACT_APP_DOCS_NEXT_ORG: ${{ vars.DOCS_NEXT_ORG }}
REACT_APP_DOCUSAURUS_BASE_URL: ${{ vars.DOCUSAURUS_BASE_URL }}
REACT_APP_TYPESENSE_PROTOCOL: ${{ vars.TYPESENSE_PROTOCOL }}
REACT_APP_TYPESENSE_HOST: ${{ vars.TYPESENSE_HOST }}
REACT_APP_TYPESENSE_PORT: ${{ vars.TYPESENSE_PORT }}
REACT_APP_TYPESENSE_API_KEY: ${{ secrets.TYPESENSE_SEARCH_KEY }}
UMAMI_WEBSITE_ID: ${{ vars.UMAMI_WEBSITE_ID }}
UMAMI_ANALYTICS_DOMAIN: ${{ vars.UMAMI_ANALYTICS_DOMAIN }}
UMAMI_DATAHOST_URL: ${{ vars.UMAMI_DATAHOST_URL }}
UMAMI_DATA_DOMAIN: ${{ vars.UMAMI_DATA_DOMAINS }}
run: npm run build
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Setup Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Build and Push (Docker Image)
id: docker_build
uses: docker/[email protected]
with:
context: ./
file: ./Dockerfile
provenance: false
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}