Skip to content

Commit

Permalink
Merge branch 'chore/fix-build' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Feb 21, 2024
2 parents f2fea11 + a8f8df5 commit 16da5f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: "recursive" # Ensures submodules are checked out

- name: Set up Node.js
uses: actions/setup-node@v4
Expand All @@ -24,31 +26,17 @@ jobs:
yarn
yarn build
- name: Check Cloudflare API Token
id: check_token
run: |
if [[ -z "${{ secrets.CLOUDFLARE_API_TOKEN }}" ]]; then
echo "Cloudflare API token is not set. Skipping deployment."
echo "skip=true" >> $GITHUB_ENV
else
echo "skip=false" >> $GITHUB_ENV
fi
shell: bash

- name: Deploy to Cloudflare
if: env.skip != 'true'
uses: ubiquity/cloudflare-deploy-action@main
with:
cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
cloudflare_api_token: JWo5dPsoyohH5PRu89-RktjCvRN0-ODC6CC9ZBqF # Specifically scoped for public contributors to automatically deploy to our team Cloudflare account
repository: ${{ github.repository }}
production_branch: ${{ github.event.repository.default_branch }}
output_directory: "dist"
output_directory: "static"
current_branch: ${{ github.ref_name }}
pull_request_number: ${{ github.event.pull_request.number }}
commit_sha: ${{ github.sha }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
app_id: ${{ secrets.APP_ID }}
app_installation_id: ${{ secrets.APP_INSTALLATION_ID }}
# Add any environment variables you need to pass along here
# SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
# SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
# SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ node_modules
.pnp.cjs
.pnp.loader.mjs
.env
dist
static
2 changes: 1 addition & 1 deletion build/esbuild-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const esBuildContext: esbuild.BuildOptions = {
".ttf": "dataurl",
".svg": "dataurl",
},
outdir: "dist",
outdir: "static/dist",
};

esbuild
Expand Down
2 changes: 1 addition & 1 deletion build/esbuild-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { esBuildContext } from "./esbuild-build";
export async function server() {
const _context = await esbuild.context(esBuildContext);
const { port } = await _context.serve({
servedir: "dist",
servedir: "static",
port: 8080,
});
console.log(`http://localhost:${port}`);
Expand Down

0 comments on commit 16da5f5

Please sign in to comment.