Skip to content

Commit

Permalink
Maybe write out the netlify state file
Browse files Browse the repository at this point in the history
  • Loading branch information
ForbesLindesay committed Jan 12, 2024
1 parent 368cca9 commit a046973
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/workflows-src/website.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {

run('yarn workspace @databases/website build');

run(`npm install netlify-cli`);
// run(`npm install netlify-cli`);
run(
interpolate`mkdir .netlify && echo '{"siteId": "${secrets.NETLIFY_SITE_ID}"}' > .netlify/state.json`,
);
when(eq(github.event_name, `push`), () => {
run(
`npx netlify-cli deploy --filter @databases/website --prod --dir=packages/website/out`,
`netlify deploy --filter @databases/website --prod --dir=packages/website/out`,
{
env: {
NETLIFY_SITE_ID: secrets.NETLIFY_SITE_ID,
Expand All @@ -45,7 +48,7 @@ export default createWorkflow(({setWorkflowName, addTrigger, addJob}) => {
});
when(neq(github.event_name, `push`), () => {
run(
`npx netlify-cli deploy --filter @databases/website --dir=packages/website/out`,
`netlify deploy --filter @databases/website --dir=packages/website/out`,
{
env: {
NETLIFY_SITE_ID: secrets.NETLIFY_SITE_ID,
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ jobs:
key: next-${{hashFiles('yarn.lock')}}
restore-keys: next-
- run: yarn workspace @databases/website build
- run: "mkdir .netlify && echo '{\"siteId\": \"${{secrets.NETLIFY_SITE_ID}}\"}' >
.netlify/state.json"
- if: ${{ github.event_name == 'push' }}
run: netlify deploy --filter @databases/website --prod
--dir=packages/website/out
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ packages/*/.cache

.last_build

website/build
website/build
# Local Netlify folder
.netlify

0 comments on commit a046973

Please sign in to comment.