-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPDATE: production-ize next.js version
- Loading branch information
1 parent
47a1efe
commit 0be5960
Showing
12 changed files
with
95 additions
and
27 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,64 @@ | ||
name: deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
workflow_dispatch: | ||
|
||
# Environment variables available to all jobs and steps in this workflow | ||
# NOTE: these aren't really secret, but there aren't non-secret settings | ||
env: | ||
RUN_PROJECT: ${{ secrets.RUN_PROJECT }} | ||
RUN_REGION: ${{ secrets.RUN_REGION }} | ||
RUN_SERVICE: ${{ secrets.RUN_SERVICE }} | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to CloudRun | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: gcloud auth | ||
id: 'auth' | ||
uses: 'google-github-actions/auth@v0' | ||
with: | ||
credentials_json: '${{ secrets.GCP_SA_KEY }}' | ||
|
||
# Setup gcloud CLI | ||
- name: gcloud setup | ||
uses: google-github-actions/setup-gcloud@v0 | ||
|
||
- name: gcloud docker-auth | ||
run: gcloud auth configure-docker | ||
|
||
# Build and push image to Google Container Registry | ||
- name: Build | ||
run: | | ||
docker build \ | ||
--build-arg COMMIT=${GITHUB_SHA:0:7} \ | ||
--build-arg LASTMOD=$(date -u +%Y-%m-%dT%H:%M:%SZ) \ | ||
--tag gcr.io/${RUN_PROJECT}/${RUN_SERVICE}:$GITHUB_SHA \ | ||
. | ||
- name: GCloud auth to docker | ||
run: | | ||
gcloud auth configure-docker | ||
- name: Push to registry | ||
run: | | ||
docker push gcr.io/${RUN_PROJECT}/${RUN_SERVICE}:$GITHUB_SHA | ||
# Deploy image to Cloud Run | ||
- name: Deploy | ||
run: | | ||
gcloud run deploy ${RUN_SERVICE} \ | ||
--allow-unauthenticated \ | ||
--image gcr.io/${RUN_PROJECT}/${RUN_SERVICE}:$GITHUB_SHA \ | ||
--platform managed \ | ||
--project ${RUN_PROJECT} \ | ||
--region ${RUN_REGION} |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
// WTF is this? A hack to workaround next.js static export bizarre behavior | ||
export const suffix = process.env.NODE_ENV === 'production' ? '.html' : ''; |
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 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