-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Ebubeker/goat-frontend
- Loading branch information
Showing
23 changed files
with
434 additions
and
975 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
######################################################################################## | ||
# "client-cache-build" composite action for client build # | ||
#--------------------------------------------------------------------------------------# | ||
# # | ||
# Usage in workflows steps: # | ||
# # | ||
# - name: 🏗️ Monorepo build # | ||
# uses: ./.github/actions/client-cache-build # | ||
# with: # | ||
# cwd: ${{ github.workspace }}/apps/goat # (default = '.') # | ||
######################################################################################## | ||
|
||
name: "Cache production build binaries" | ||
description: "Cache or restore if necessary" | ||
author: "Plan4Better GmbH" | ||
|
||
inputs: | ||
cwd: | ||
description: "Changes node's process.cwd() if the project is not located on the root. Default to process.cwd()" | ||
required: false | ||
default: '.' | ||
node_version: | ||
description: "Node version to use" | ||
required: false | ||
default: v18.x | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Cache production build | ||
uses: actions/cache@v3 | ||
id: cache-build | ||
env: | ||
cache-name: prod-build | ||
key-1: ${{ inputs.node_version }}-${{ hashFiles('${{ inputs.cwd }}/pnpm-lock.yaml') }} | ||
key-2: ${{ hashFiles('${{ inputs.cwd }}/apps/**/**.[jt]s', '${{ inputs.cwd }}/apps/**/**.[jt]sx', '${{ inputs.cwd }}/packages/**/**.[jt]s', '${{ inputs.cwd }}/packages/**/**.[jt]sx', '!**/node_modules') }} | ||
key-3: ${{ github.event.pull_request.number || github.ref }} | ||
# Ensures production-build.yml will always be fresh | ||
key-4: ${{ github.sha }} | ||
with: | ||
path: | | ||
${{ github.workspace }}/app/client/apps/goat/.next | ||
**/.turbo/** | ||
**/dist/** | ||
key: ${{ runner.os }}-${{ env.cache-name }}-${{ env.key-1 }}-${{ env.key-2 }}-${{ env.key-3 }}-${{ env.key-4 }} | ||
|
||
- run: pnpm run build | ||
working-directory: ${{ inputs.cwd }} | ||
if: steps.cache-build.outputs.cache-hit != 'true' | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,29 @@ | ||
name: "Release" | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
release-goat: | ||
name: release-goat | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 📥 Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: 🐳 Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: 🐳 Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: 🐳 Docker meta | ||
id: docker_meta | ||
uses: docker/metadata-action@v4.6.0 | ||
with: | ||
images: goatcommunity/goat-frontend | ||
flavor: | | ||
latest=auto | ||
tags: | | ||
type=raw,value={{sha}} | ||
type=ref,event=tag,priority=200 | ||
type=raw,value=latest,enable=${{startsWith(github.ref, 'refs/tags/v' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) )}},priority=100, | ||
type=ref,event=pr,priority=100 | ||
- name: 🐳 Build docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ${{ github.workspace }} | ||
file: ${{ github.workspace }}/apps/goat/Dockerfile | ||
push: ${{ github.event_name != 'pull_request' }} | ||
platforms: linux/amd64 | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: 🐳 Find the primary image tag we just pushed, and output it | ||
id: image-tag | ||
run: | | ||
echo "image-tag=${{ steps.docker_meta.outputs.version }}" >> $GITHUB_OUTPUT | ||
release-docker: | ||
name: release | ||
uses: "goat-community/.github/.github/workflows/reusable-docker-build.yml@main" | ||
permissions: | ||
contents: read | ||
packages: write | ||
pull-requests: write | ||
secrets: | ||
dockerhub-username: ${{ secrets.DOCKER_USERNAME }} | ||
dockerhub-token: ${{ secrets.DOCKER_PASSWORD }} | ||
with: | ||
dockerhub-enable: true | ||
ghcr-enable: false | ||
push: ${{ github.event_name != 'pull_request' }} | ||
file: ${{ github.workspace }}/apps/goat/Dockerfile | ||
image-names: | | ||
goatcommunity/goat-frontend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.