Skip to content

Commit

Permalink
Merge pull request #5 from akyriako/create-build-workflow
Browse files Browse the repository at this point in the history
Create build workflow
  • Loading branch information
akyriako authored Jul 9, 2024
2 parents 0fd040d + 75d9919 commit 4de4298
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 5 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
environment: preview
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 18 # Use Node.js 18 here

- name: Install Dependencies
run: npm install

- name: Build App
env:
TYPESENSE_PROTOCOL: ${{ vars.TYPESENSE_PROTOCOL }}
TYPESENSE_HOST: ${{ vars.TYPESENSE_HOST }}
TYPESENSE_PORT: ${{ vars.TYPESENSE_PORT }}
TYPESENSE_API_KEY: ${{ secrets.TYPESENSE_API_KEY }}
run: npm run build

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Get Commit Hash
id: commit_hash
uses: prompt/actions-commit-hash@v3
- uses: docker/setup-buildx-action@v3
- name: Build and Push (Docker Image)
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/${{ vars.IMG_NAME }}:latest
${{ secrets.DOCKERHUB_USERNAME }}/${{ vars.IMG_NAME }}:${{ steps.commit_hash.outputs.short }}
# - name: Image Digest
# run: echo ${{ steps.docker_build.outputs.digest }}

update-tag:
needs: build
environment: preview
runs-on: ubuntu-latest
steps:
- name: Get Commit Hash
id: commit_hash
uses: prompt/actions-commit-hash@v3
- name: Show Commit Hash Digest
run: echo ${{ steps.commit_hash.outputs.short }}
- name: Update Image Tag
uses: cheelim1/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
REPO_NAME: 'docs-next-charts'
REPO_OWNER: 'akyriako'
FILE_PATH: 'docusaurus/values.yaml'
IMAGE_TAG: ${{ steps.commit_hash.outputs.short }}




10 changes: 5 additions & 5 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

const config: Config = {
title: 'Architecture Center docs-next:theme.7',
title: 'Architecture Center',
tagline: 'Best Practices & Blueprints',
favicon: 'img/favicon.ico',

Expand Down Expand Up @@ -224,12 +224,12 @@ const config: Config = {
typesenseServerConfig: {
nodes: [
{
host: "docs-search.hypelens.de",
port: 80,
protocol: "http",
host: process.env.TYPESENSE_HOST,
port: process.env.TYPESENSE_PORT,
protocol: process.env.TYPESENSE_PROTOCOL,
},
],
apiKey: "j2Q51UsLuh9guYtc4x147Mv5X74g4iSI",
apiKey: process.env.TYPESENSE_API_KEY,
},

// Optional: Typesense search parameters: https://typesense.org/docs/0.24.0/api/search.html#search-parameters
Expand Down

0 comments on commit 4de4298

Please sign in to comment.