-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
13 changed files
with
767 additions
and
49 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,9 @@ | ||
# Automation | ||
|
||
Automating tasks with GitHub Actions | ||
|
||
## TODO | ||
|
||
### Examples | ||
|
||
- https://github.com/kporten/template-react/tree/main/.github/workflows |
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,24 @@ | ||
name: Ignore | ||
description: Determine if a workspace has new changes that need to be deployed | ||
|
||
inputs: | ||
workspace: | ||
description: Workspace name to check | ||
required: true | ||
|
||
outputs: | ||
ignore: | ||
description: Boolean value that indicates if the workspace can be ignored | ||
value: ${{ steps.check.outputs.ignore }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- id: check | ||
run: | | ||
if ! pnpm dlx turbo-ignore ${{ inputs.workspace }}; then | ||
echo "ignore=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "ignore=true" >> $GITHUB_OUTPUT | ||
fi | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
inputs: | ||
CACHIX_AUTH_TOKEN: | ||
required: true | ||
name: Setup | ||
description: Setup environment and cache | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install nix | ||
uses: cachix/install-nix-action@v21 | ||
|
||
- name: Setup cachix | ||
uses: cachix/cachix-action@v12 | ||
- uses: pnpm/action-setup@v3 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
name: gerschtli | ||
authToken: ${{ inputs.CACHIX_AUTH_TOKEN }} | ||
|
||
- name: Build dev shell | ||
node-version: lts/* | ||
cache: pnpm | ||
- run: pnpm install | ||
shell: bash | ||
- run: pnpm add --global turbo | ||
shell: bash | ||
run: nix develop --profile profile && rm profile |
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,19 @@ | ||
inputs: | ||
CACHIX_AUTH_TOKEN: | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Install nix | ||
uses: cachix/install-nix-action@v21 | ||
|
||
- name: Setup cachix | ||
uses: cachix/cachix-action@v12 | ||
with: | ||
name: gerschtli | ||
authToken: ${{ inputs.CACHIX_AUTH_TOKEN }} | ||
|
||
- name: Build dev shell | ||
shell: bash | ||
run: nix develop --profile profile && rm profile |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,157 @@ | ||
name: Deployment | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
versioning: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
published: ${{ steps.changesets.outputs.published }} | ||
steps: | ||
- name: 📥 Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: ⚙️ Setup | ||
uses: ./.github/actions/setup | ||
- name: 📝 Process changesets | ||
uses: changesets/action@v1 | ||
id: changesets | ||
with: | ||
title: 'chore: update versions' | ||
commit: 'chore: update versions' | ||
version: pnpm exec changeset version | ||
publish: pnpm exec changeset tag | ||
createGithubReleases: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
status: | ||
if: needs.versioning.outputs.published == 'true' | ||
needs: | ||
- versioning | ||
runs-on: ubuntu-latest | ||
outputs: | ||
express-ignore: ${{ steps.express.outputs.ignore }} | ||
keystone-ignore: ${{ steps.keystone.outputs.ignore }} | ||
next-ignore: ${{ steps.next.outputs.ignore }} | ||
vite-ignore: ${{ steps.vite.outputs.ignore }} | ||
steps: | ||
- name: 📥 Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: ⚙️ Setup | ||
uses: ./.github/actions/setup | ||
- name: 🪄 Analyze express app | ||
id: express | ||
uses: ./.github/actions/ignore | ||
with: | ||
workspace: express | ||
- name: 🪄 Analyze keystone app | ||
id: keystone | ||
uses: ./.github/actions/ignore | ||
with: | ||
workspace: keystone | ||
- name: 🪄 Analyze next app | ||
id: next | ||
uses: ./.github/actions/ignore | ||
with: | ||
workspace: next | ||
- name: 🪄 Analyze vite app | ||
id: vite | ||
uses: ./.github/actions/ignore | ||
with: | ||
workspace: vite | ||
|
||
express: | ||
if: needs.status.outputs.express-ignore == 'false' | ||
needs: | ||
- status | ||
runs-on: ubuntu-latest | ||
env: | ||
TURBO_API: ${{ vars.TURBO_API }} | ||
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
steps: | ||
- name: 📥 Checkout | ||
uses: actions/checkout@v3 | ||
- name: ⚙️ Setup | ||
uses: ./.github/actions/setup | ||
- name: 🏗️ Build | ||
run: turbo build --filter express | ||
# - name: 🚀 Deploy | ||
# run: | ||
|
||
keystone: | ||
if: needs.status.outputs.keystone-ignore == 'false' | ||
needs: | ||
- status | ||
runs-on: ubuntu-latest | ||
env: | ||
TURBO_API: ${{ vars.TURBO_API }} | ||
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
steps: | ||
- name: 📥 Checkout | ||
uses: actions/checkout@v3 | ||
- name: ⚙️ Setup | ||
uses: ./.github/actions/setup | ||
- name: 🏗️ Build | ||
run: turbo build --filter keystone | ||
env: | ||
SKIP_ENV_REQUIRED: 1 | ||
# - name: 🚀 Deploy | ||
# run: | ||
|
||
next: | ||
if: needs.status.outputs.next-ignore == 'false' | ||
needs: | ||
- status | ||
runs-on: ubuntu-latest | ||
env: | ||
TURBO_API: ${{ vars.TURBO_API }} | ||
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
steps: | ||
- name: 📥 Checkout | ||
uses: actions/checkout@v3 | ||
- name: ⚙️ Setup | ||
uses: ./.github/actions/setup | ||
- name: 🏗️ Build | ||
run: turbo build --filter next | ||
# - name: 🚀 Deploy | ||
# run: | ||
|
||
vite: | ||
if: needs.status.outputs.vite-ignore == 'false' | ||
needs: | ||
- status | ||
runs-on: ubuntu-latest | ||
env: | ||
TURBO_API: ${{ vars.TURBO_API }} | ||
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
steps: | ||
- name: 📥 Checkout | ||
uses: actions/checkout@v3 | ||
- name: ⚙️ Setup | ||
uses: ./.github/actions/setup | ||
- name: 🏗️ Build | ||
run: turbo build --filter vite | ||
# env: | ||
# VITE_CLERK_PUBLISHABLE_KEY: ${{ vars.VITE_CLERK_PUBLISHABLE_KEY }} | ||
# VITE_SENTRY_DSN: ${{ vars.SENTRY_DSN }} | ||
# VITE_TRPC_URL: ${{ vars.VITE_TRPC_URL }} | ||
# - name: 🚀 Deploy | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: vite | ||
# path: ./apps/vite/dist | ||
# if-no-files-found: error | ||
# retention-days: 1 |
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.