From 1ebe001afadeba2992ce2c0dd8e4f609c032bb29 Mon Sep 17 00:00:00 2001 From: C4 Patino Date: Sat, 26 Mar 2022 19:26:15 -0500 Subject: [PATCH] Updated build and dist --- .github/workflows/build-release.js.yml | 29 +++++++++++++++++--------- .gitignore | 2 ++ package.json | 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-release.js.yml b/.github/workflows/build-release.js.yml index 96be34d..072699d 100644 --- a/.github/workflows/build-release.js.yml +++ b/.github/workflows/build-release.js.yml @@ -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 diff --git a/.gitignore b/.gitignore index 54931d6..d71b55d 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/package.json b/package.json index a62060b..d9eff92 100644 --- a/package.json +++ b/package.json @@ -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",