Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/myfix #41

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Build
run: |
npm install -g @angular/cli
npm install
node ./.github/workflows/ng-env-replace.js
ng build --prod --base-href="/redis-patterns-console/"
env:
REDIS_SERVER_API_WS: ${{ secrets.REDIS_SERVER_API_WS }}
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v2
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
BASE_BRANCH: master
BRANCH: gh-pages
FOLDER: dist
7 changes: 7 additions & 0 deletions .github/workflows/ng-env-replace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const fs = require('fs');

const targetPath = './src/environments/environment.prod.ts';
const file = fs.readFileSync(targetPath ,'utf8');
const newFile = file.replace('REDIS_SERVER_API_WS', process.env.REDIS_SERVER_API_WS);

fs.writeFileSync(targetPath , newFile);
1 change: 1 addition & 0 deletions src/prova.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
file di prova