Skip to content

Commit

Permalink
added production release wf #157
Browse files Browse the repository at this point in the history
  • Loading branch information
akyriako committed Nov 14, 2024
1 parent f556063 commit a672c9f
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 191 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/build-publish-production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build and Deploy Production Docker Images

on:
push:
tags:
- "v*.*.*"
workflow_dispatch:

jobs:
build-stable:
name: Build Production Artifacts
environment:
name: stable
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: Build Version Tag
id: build_version_tag
run: echo "IMAGE_SEMVER=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Build Container Image Metadata
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
${{ vars.REGISTRY }}/${{ vars.REGISTRY_ORG }}/docusaurus-play
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}
type=raw,value=latest

- name: Build App
env:
REACT_APP_VERSION: ${{ env.IMAGE_SEMVER }}
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/setup-buildx-action@v3.7.1

- name: Build and Push (Docker Image)
id: docker_build
uses: docker/build-push-action@v6.9.0
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 }}
14 changes: 7 additions & 7 deletions .github/workflows/build-publish-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
push:
branches:
- main
# paths-ignore:
# - '**/README.md'
# - '**/CONTRIBUTING.md'
# - '**/CONFIGURATION.md'
# - '**/.devcontainer/**'
# - "**/.github/workflows/**"
paths-ignore:
- '**/README.md'
- '**/CONTRIBUTING.md'
- '**/CONFIGURATION.md'
- '**/.devcontainer/**'
- "**/.github/workflows/**"

jobs:
build-preview:
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Login to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKERHUB_REGISTRY }}
registry: ${{ vars.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}

Expand Down
184 changes: 0 additions & 184 deletions .github/workflows/release.yaml

This file was deleted.

0 comments on commit a672c9f

Please sign in to comment.