-
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.
[#5] Config deploy-preview and deploy workflow to deploy app to produ…
…ction
- Loading branch information
Showing
5 changed files
with
89 additions
and
0 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,45 @@ | ||
name: Deploy to Netlify | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
workflow_dispatch: | ||
inputs: | ||
deploy-msg: | ||
description: 'Deploy to Production' | ||
required: true | ||
|
||
jobs: | ||
deploy: | ||
name: Build and Deploy to Netlify | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
|
||
- name: Install modules | ||
run: npm ci | ||
|
||
- name: Decode .env file | ||
run: echo "${{ secrets.ENV_FILE_CONTENT }}" | base64 -d > .env | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Deploy to Netlify | ||
uses: nwtgck/[email protected] | ||
with: | ||
publish-dir: './build' | ||
deploy-message: 'Deploy from GitHub Actions: ${{ github.event.inputs.deploy-msg }}' | ||
production-deploy: true | ||
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
enable-commit-comment: false | ||
env: | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||
timeout-minutes: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Deploy Preview to Netlify | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
deploy-preview: | ||
name: Build and Deploy preview on Netlify | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
|
||
- name: Install modules | ||
run: npm ci | ||
|
||
- name: Decode .env file | ||
run: echo "${{ secrets.ENV_FILE_CONTENT }}" | base64 -d > .env | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
- name: Deploy to Netlify | ||
uses: nwtgck/[email protected] | ||
with: | ||
publish-dir: './build' | ||
deploy-message: '#${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}' | ||
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }} | ||
enable-commit-comment: false | ||
env: | ||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||
timeout-minutes: 3 |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
REACT_APP_DEFAULT_LANGUAGE=en | ||
REACT_APP_DUMMY_ENV=example |
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