commit
e3de3c8e5f
4 changed files with 13 additions and 16 deletions
10
.github/workflows/deploy-dev.yml
vendored
10
.github/workflows/deploy-dev.yml
vendored
|
@ -19,10 +19,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- run: mkdir ~/.ssh
|
|
||||||
- run: 'echo "$SSH_KEY" >> ~/.ssh/id_rsa_ifsalas'
|
|
||||||
- run: chmod 400 ~/.ssh/id_rsa_ifsalas
|
|
||||||
- run: echo -e "Host ifsalas\n\tUser ifsalas\n\tHostname 45.76.5.44\n\tIdentityFile ~/.ssh/id_rsa_ifsalas\n\tStrictHostKeyChecking No" >> ~/.ssh/config
|
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm run build:dev
|
- run: npm run build:dev
|
||||||
- run: npm run deploy:dev
|
- run: mkdir ~/.ssh
|
||||||
|
- run: echo "$SSH_KEY" >> ~/.ssh/id_rsa_ifsalas
|
||||||
|
- run: chmod 400 ~/.ssh/id_rsa_ifsalas
|
||||||
|
- run: echo -e "Host ifsalas\n\tUser ifsalas\n\tHostname 45.76.5.44\n\tIdentityFile ~/.ssh/id_rsa_ifsalas\n\tStrictHostKeyChecking No" >> ~/.ssh/config
|
||||||
|
- run: rsync -avz --progress build/ ifsalas:/home/ifsalas/web/dev --delete
|
||||||
|
|
10
.github/workflows/deploy-prod.yml
vendored
10
.github/workflows/deploy-prod.yml
vendored
|
@ -19,10 +19,10 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- run: mkdir ~/.ssh
|
|
||||||
- run: 'echo "$SSH_KEY" >> ~/.ssh/id_rsa_ifsalas'
|
|
||||||
- run: chmod 400 ~/.ssh/id_rsa_ifsalas
|
|
||||||
- run: echo -e "Host ifsalas\n\tUser ifsalas\n\tHostname 45.76.5.44\n\tIdentityFile ~/.ssh/id_rsa_ifsalas\n\tStrictHostKeyChecking No" >> ~/.ssh/config
|
|
||||||
- run: npm install
|
- run: npm install
|
||||||
- run: npm run build:prod
|
- run: npm run build:prod
|
||||||
- run: npm run deploy:prod
|
- run: mkdir ~/.ssh
|
||||||
|
- run: echo "$SSH_KEY" >> ~/.ssh/id_rsa_ifsalas
|
||||||
|
- run: chmod 400 ~/.ssh/id_rsa_ifsalas
|
||||||
|
- run: echo -e "Host ifsalas\n\tUser ifsalas\n\tHostname 45.76.5.44\n\tIdentityFile ~/.ssh/id_rsa_ifsalas\n\tStrictHostKeyChecking No" >> ~/.ssh/config
|
||||||
|
- run: rsync -avz --progress build/ ifsalas:/home/ifsalas/web/prod --delete
|
||||||
|
|
|
@ -30,9 +30,7 @@
|
||||||
"start:dev": "env-cmd -f .env.dev npm run start",
|
"start:dev": "env-cmd -f .env.dev npm run start",
|
||||||
"start:prod": "env-cmd -f .env.prod npm run start ",
|
"start:prod": "env-cmd -f .env.prod npm run start ",
|
||||||
"build:dev": "env-cmd -f .env.dev npm run build",
|
"build:dev": "env-cmd -f .env.dev npm run build",
|
||||||
"build:prod": "env-cmd -f .env.prod npm run build",
|
"build:prod": "env-cmd -f .env.prod npm run build"
|
||||||
"deploy:prod": "rsync -avz --progress build/ ifsalas:/home/ifsalas/web/prod --delete",
|
|
||||||
"deploy:dev": "rsync -avz --progress build/ ifsalas:/home/ifsalas/web/dev --delete"
|
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"extends": [
|
"extends": [
|
||||||
|
|
|
@ -22,8 +22,7 @@ function AuthProvider(props) {
|
||||||
|
|
||||||
const register = data => {
|
const register = data => {
|
||||||
setState({ ...state, status: 'pending' });
|
setState({ ...state, status: 'pending' });
|
||||||
let shouldFail =
|
let shouldFail = false;
|
||||||
data.email !== 'leo@gmail.com' && data.password !== '#leo1234';
|
|
||||||
|
|
||||||
return registerUser(data, shouldFail).then(data => {
|
return registerUser(data, shouldFail).then(data => {
|
||||||
if (shouldFail) {
|
if (shouldFail) {
|
||||||
|
@ -36,7 +35,7 @@ function AuthProvider(props) {
|
||||||
|
|
||||||
const login = (email, password) => {
|
const login = (email, password) => {
|
||||||
setState({ ...state, status: 'pending' });
|
setState({ ...state, status: 'pending' });
|
||||||
let shouldFail = email !== 'leo@gmail.com' && password !== '#leo1234';
|
let shouldFail = email !== 'teste@teste.com' || password !== '#teste1234';
|
||||||
|
|
||||||
return getUser(shouldFail).then(data => {
|
return getUser(shouldFail).then(data => {
|
||||||
if (shouldFail) {
|
if (shouldFail) {
|
||||||
|
|
Loading…
Reference in a new issue