-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f904a83
commit 0e9e012
Showing
9 changed files
with
108 additions
and
129 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 |
---|---|---|
@@ -1,47 +1,52 @@ | ||
# name: Build and Deploy | ||
|
||
# on: | ||
# workflow_call: | ||
# inputs: | ||
# APP_NAME: | ||
# required: true | ||
# type: string | ||
# BUCKET: | ||
# required: true | ||
# type: string | ||
|
||
# jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
|
||
# - uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: 19 | ||
|
||
# - uses: pnpm/action-setup@v2 | ||
# with: | ||
# version: 8 | ||
|
||
# - name: Install Dependencies | ||
# run: pnpm install | ||
|
||
# - name: Build | ||
# run: pnpm generate --filter=${{ inputs.APP_NAME }} | ||
|
||
# - name: Configure AWS Credentials | ||
# uses: aws-actions/configure-aws-credentials@v2 | ||
# with: | ||
# aws-region: sa-east-1 | ||
# role-to-assume: arn:aws:iam::928571631969:role/gh-actions-menthorlabs-menthor | ||
|
||
# - name: Install AWS CLI | ||
# id: install-aws-cli | ||
# uses: unfor19/install-aws-cli-action@master | ||
|
||
# - name: Push to S3 | ||
# run: aws s3 cp apps/${{ inputs.APP_NAME }}/dist ${{ inputs.BUCKET }} --recursive | ||
|
||
# - name: Invalidate CloudFront | ||
# run: aws cloudfront create-invalidation --distribution-id E2B0K34D9WKXHA --paths "/*" | ||
name: Build and Deploy - Cloudflare Pages | ||
on: | ||
workflow_call: | ||
inputs: | ||
CLOUDFLARE_ENV: | ||
required: false | ||
type: string | ||
default: ${{ contains(github.ref, 'main') && 'prod' || contains(github.ref, 'staging') && 'staging' || 'dev'}} | ||
NODE_ENV: | ||
required: false | ||
type: string | ||
default: ${{ contains(github.ref, 'main') && 'production' || contains(github.ref, 'staging') && 'staging' || 'development'}} | ||
APP_NAME: | ||
required: true | ||
type: string | ||
CLOUDFLARE_PROJECT_NAME: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
setup-build-publish-deploy: | ||
name: Publish to Cloudflare Pages | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
deployments: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 19 | ||
|
||
- name: Setup Yarn | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install | ||
|
||
- name: Build Production Bundle | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: build:${{ inputs.NODE_ENV }} --filter=${{ inputs.APP_NAME }} | ||
|
||
- name: Publish to Cloudflare Pages | ||
uses: cloudflare/pages-action@v1 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }} | ||
accountId: d8803c6a6253e9267bf1000ca69db18d | ||
projectName: ${{ inputs.CLOUDFLARE_ENV }}-${{ inputs.CLOUDFLARE_PROJECT_NAME }} | ||
directory: apps/${{ inputs.APP_NAME }}/dist | ||
branch: main |
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,55 +1,51 @@ | ||
# name: Menthor Apps Deployment | ||
name: Apps Monorepo Deployment | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
- staging | ||
- main | ||
|
||
# permissions: | ||
# id-token: write | ||
# contents: read | ||
jobs: | ||
changes: | ||
name: Path filter | ||
runs-on: ubuntu-latest | ||
|
||
# jobs: | ||
# changes: | ||
# name: Path filter | ||
# runs-on: ubuntu-latest | ||
|
||
# outputs: | ||
# app: ${{ steps.filter.outputs.app }} | ||
# www: ${{ steps.filter.outputs.www }} | ||
outputs: | ||
www: ${{ steps.filter.outputs.www }} | ||
app: ${{ steps.filter.outputs.app }} | ||
|
||
# steps: | ||
# - name: Checkout | ||
# uses: 'actions/checkout@v3' | ||
steps: | ||
- name: Checkout | ||
uses: 'actions/checkout@v3' | ||
|
||
# - uses: dorny/paths-filter@v2 | ||
# id: filter | ||
# with: | ||
# base: ${{ github.ref }} | ||
# filters: | | ||
# app: | ||
# - '.env.*' | ||
# - 'apps/app/**' | ||
# - 'packages/**' | ||
# www: | ||
# - '.env.*' | ||
# - 'apps/www/**' | ||
# - 'packages/**' | ||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
base: ${{ github.ref }} | ||
filters: | | ||
www: | ||
- '.env.*' | ||
- 'apps/www/**' | ||
- 'packages/**' | ||
app: | ||
- '.env.*' | ||
- 'apps/app/**' | ||
- 'packages/**' | ||
# app-deploy: | ||
# needs: changes | ||
# if: ${{ needs.changes.outputs.app == 'true' }} | ||
# secrets: inherit | ||
# uses: ./.github/workflows/deploy.yml | ||
# with: | ||
# APP_NAME: app | ||
# BUCKET: s3://menthor.io-app/app | ||
www-deploy: | ||
needs: changes | ||
if: ${{ needs.changes.outputs.www == 'true' }} | ||
secrets: inherit | ||
uses: ./.github/workflows/deploy-cloudrun.yaml | ||
with: | ||
APP_NAME: www | ||
|
||
# www-deploy: | ||
# needs: changes | ||
# if: ${{ needs.changes.outputs.www == 'true' }} | ||
# secrets: inherit | ||
# uses: ./.github/workflows/deploy.yml | ||
# with: | ||
# APP_NAME: www | ||
# BUCKET: s3://menthor.io | ||
app-deploy: | ||
needs: changes | ||
if: ${{ needs.changes.outputs.app == 'true' }} | ||
secrets: inherit | ||
uses: ./.github/workflows/deploy-cloudrun.yaml | ||
with: | ||
APP_NAME: app |
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 |
---|---|---|
|
@@ -35,3 +35,6 @@ yarn-error.log* | |
|
||
# vercel | ||
.vercel | ||
|
||
# wrangler | ||
.wrangler |
Binary file not shown.
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 was deleted.
Oops, something went wrong.