Updated build and dist

This commit is contained in:
Ceferino Patino 2022-03-26 19:26:15 -05:00
commit 1ebe001afa
3 changed files with 22 additions and 11 deletions

View file

@ -10,20 +10,29 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
- name: Write .env to build
env:
BUILD_PATH: '${{ secrets.BUILD_PATH }}'
COURIER_AUTH_TOKEN: '${{ secrets.COURIER_AUTH_TOKEN }}'
NODE_ENV: '${{ secrets.NODE_ENV }}'
PORT: '${{ secrets.PORT }}'
REACT_APP_API_ROOT: '${{ secrets.REACT_APP_API_ROOT }}'
REACT_APP_DOMAIN_ROOT: '${{ secrets.REACT_APP_DOMAIN_ROOT }}'
run: |
echo $BUILD_PATH > .env
echo $COURIER_AUTH_TOKEN >> .env
echo $NODE_ENV >> .env
echo $PORT >> .env
echo $REACT_APP_API_ROOT >> .env
echo $REACT_APP_DOMAIN_ROOT >> .env
cat .env
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16
node-version: 16.x
- name: Install dependencies and build
run: npm run dist
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist.tar.gz
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
env:
GITHUB_REPOSITORY: C4theBomb/node_test_site

2
.gitignore vendored
View file

@ -2,6 +2,8 @@
# Created by https://www.toptal.com/developers/gitignore/api/node,react,git,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=node,react,git,visualstudiocode
**/dist.tar.gz
### Express ###
**/public/

View file

@ -10,7 +10,7 @@
"test": "npm run build && npm run server",
"install-all": "npm ci && npm ci --prefix client && npm ci --prefix server",
"env": "cp .env ./server/.env && cp .env ./client/.env",
"dist": "npm run install-all && npm run build && tar -czvf ./dist.tar.gz ../"
"dist": "npm run install-all && npm run build && tar -czf ./dist.tar.gz ./"
},
"author": "C4 Patino",
"license": "ISC",