From a709e404eb2e8ab87ce282b1e2a1f86eb583ddc9 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 1 Dec 2021 09:49:07 -0300 Subject: [PATCH 01/60] adding github-actions --- .github/workflows/github-actions.yml | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/github-actions.yml diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml new file mode 100644 index 0000000..f3e5190 --- /dev/null +++ b/.github/workflows/github-actions.yml @@ -0,0 +1,40 @@ +name: GitHub Actions Demo +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + Explore-GitHub-Actions: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v2 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run code style check + run: npm run lint + - name: Run code formatter + run: npm run prettier + - run: npm run build --if-present + - run: npm test From 172321a1954bcfbc6d6c03b54ef4d1134e4de971 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 1 Dec 2021 10:57:04 -0300 Subject: [PATCH 02/60] test adding eslint-disable-next-line --- src/direflow-components/Form/Collection.js | 1 + src/direflow-components/Form/FormStack.js | 3 +++ src/direflow-components/Form/SelectEntities.js | 5 ++++- src/direflow-components/Table/Table.js | 4 ++++ src/direflow-components/Wrapper.js | 1 + 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/direflow-components/Form/Collection.js b/src/direflow-components/Form/Collection.js index 0949af5..27c6d2f 100644 --- a/src/direflow-components/Form/Collection.js +++ b/src/direflow-components/Form/Collection.js @@ -203,6 +203,7 @@ const Collection = ({ } ); } + // eslint-disable-next-line }, [parentId]); const handleSearch = (selectedKeys, confirm) => { diff --git a/src/direflow-components/Form/FormStack.js b/src/direflow-components/Form/FormStack.js index 8dc74b3..57d9ffe 100644 --- a/src/direflow-components/Form/FormStack.js +++ b/src/direflow-components/Form/FormStack.js @@ -78,6 +78,7 @@ const FormStack = ({ displayEntity = null, onSuccess, mode, id }) => { return newState; }); }, + // eslint-disable-next-line [entitiesStack, openForResultForms] ); @@ -120,6 +121,7 @@ const FormStack = ({ displayEntity = null, onSuccess, mode, id }) => { } }); } + // eslint-disable-next-line }, []); const onSubmit = (data, name) => { @@ -193,6 +195,7 @@ const FormStack = ({ displayEntity = null, onSuccess, mode, id }) => { ); + // eslint-disable-next-line }, [entitiesStack]); return render(); diff --git a/src/direflow-components/Form/SelectEntities.js b/src/direflow-components/Form/SelectEntities.js index 56dd852..bd7789a 100644 --- a/src/direflow-components/Form/SelectEntities.js +++ b/src/direflow-components/Form/SelectEntities.js @@ -107,6 +107,7 @@ export const SelectEntities = ({ setResponseEntity(data); }); } + // eslint-disable-next-line }, [initialValue, initialValueFromForm]); useEffect(() => { @@ -160,8 +161,8 @@ export const SelectEntities = ({ setResponseEntity(data); }); } + // eslint-disable-next-line }, [selectValues]); - const renderSelect = useCallback(() => { const options = responseEntity?.map((item) => { return ( @@ -171,6 +172,7 @@ export const SelectEntities = ({ ); }); return options; + // eslint-disable-next-line }, [responseEntity]); // siempre se va a mandar el id como field en este tipo de conexion ? @@ -226,6 +228,7 @@ export const SelectEntities = ({ ); + // eslint-disable-next-line }, [responseEntity, initialValue, initialValueFromForm]); return element(); diff --git a/src/direflow-components/Table/Table.js b/src/direflow-components/Table/Table.js index 997ca54..d6bb95d 100644 --- a/src/direflow-components/Table/Table.js +++ b/src/direflow-components/Table/Table.js @@ -181,6 +181,7 @@ const Table = ({ }; fetch(); } + // eslint-disable-next-line }, [selectValuesFilter, displayEntity, entities, url]); const handleReset = (clearFilters, entity) => { @@ -483,6 +484,7 @@ const Table = ({ }, }; }, + // eslint-disable-next-line [selectValues, selectedOperator] ); @@ -565,6 +567,7 @@ const Table = ({ if (displayEntity) { createColumns(displayEntity, getColumnSearchProps, isDate, setColumns); } + // eslint-disable-next-line }, [getColumnSearchProps]); useEffect(() => { @@ -605,6 +608,7 @@ const Table = ({ } }); } + // eslint-disable-next-line }, [displayEntity, pagination, filters, url, sort, lastDeleted]); const handleTableChange = (pagination, filters, sorter) => { diff --git a/src/direflow-components/Wrapper.js b/src/direflow-components/Wrapper.js index e442b60..f182e46 100644 --- a/src/direflow-components/Wrapper.js +++ b/src/direflow-components/Wrapper.js @@ -28,6 +28,7 @@ const Wrapper = (props) => { useEffect(() => { getData(); + // eslint-disable-next-line }, []); function selectLanguage(e) { From ab7aa8bf494fbed74ed09fec5cd23ea2e8c22ad0 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 1 Dec 2021 11:21:10 -0300 Subject: [PATCH 03/60] edit script --- .github/workflows/github-actions.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index f3e5190..4757c6b 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -1,4 +1,4 @@ -name: GitHub Actions Demo +name: GitHub Actions on: push: branches: [ main ] @@ -24,7 +24,6 @@ jobs: - name: List files in the repository run: | ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: @@ -37,4 +36,5 @@ jobs: - name: Run code formatter run: npm run prettier - run: npm run build --if-present - - run: npm test + - name: Job's status + run: echo "🍏 This job's status is ${{ job.status }}." From 86e36363fd835c5853581befcca1004df285a77e Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 1 Dec 2021 11:42:49 -0300 Subject: [PATCH 04/60] changes --- .github/workflows/github-actions.yml | 3 ++- src/direflow-components/Form/SelectEntities.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 4757c6b..e1dcffe 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -35,6 +35,7 @@ jobs: run: npm run lint - name: Run code formatter run: npm run prettier - - run: npm run build --if-present + - name: Build + run: npm run build --if-present - name: Job's status run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/src/direflow-components/Form/SelectEntities.js b/src/direflow-components/Form/SelectEntities.js index 3d54d8d..14b15d4 100644 --- a/src/direflow-components/Form/SelectEntities.js +++ b/src/direflow-components/Form/SelectEntities.js @@ -172,7 +172,7 @@ export const SelectEntities = ({ ); }); return options; - // eslint-disable-next-line + }, [responseEntity]); // siempre se va a mandar el id como field en este tipo de conexion ? From dd893deaf67f196651ece42ceed75ed8114023b1 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 1 Dec 2021 12:13:57 -0300 Subject: [PATCH 05/60] undo last change --- .../Form/SelectEntities.js | 90 ++++++++++--------- 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/src/direflow-components/Form/SelectEntities.js b/src/direflow-components/Form/SelectEntities.js index 14b15d4..cb38824 100644 --- a/src/direflow-components/Form/SelectEntities.js +++ b/src/direflow-components/Form/SelectEntities.js @@ -90,7 +90,10 @@ export const SelectEntities = ({ }, }; - let response = await requestEntity(current, url,/* 1, 10, selectFilters*/); + let response = await requestEntity( + current, + url /* 1, 10, selectFilters*/ + ); if (response && response.data) { return response.data.data[current.queryAll]; } @@ -112,54 +115,57 @@ export const SelectEntities = ({ useEffect(() => { //if (selectValues) { - const fetch = async () => { - let selectFilters = {}; + const fetch = async () => { + let selectFilters = {}; - let current; + let current; - const descriptionField = field.extensions?.relation?.displayField; + const descriptionField = field.extensions?.relation?.displayField; - entitiesContext.forEach(async (item) => { - if (item.name === field.type.name) { - current = item; - } - }); + entitiesContext.forEach(async (item) => { + if (item.name === field.type.name) { + current = item; + } + }); - currentEntity.current = current; + currentEntity.current = current; - let currentField; - current.fields.forEach((item) => { - if (item.name === descriptionField) { - currentField = item; - } - }); + let currentField; + current.fields.forEach((item) => { + if (item.name === descriptionField) { + currentField = item; + } + }); - selectFilters[descriptionField] = { - value: selectValues, - key: descriptionField, - operator: isString(currentField) ? 'LIKE' : 'EQ', - entity: { - type: { - name: isString(currentField) - ? 'String' - : isNumber(currentField) - ? 'Int' - : isBoolean(currentField) - ? 'Boolean' - : 'DateTime', - kind: 'SCALAR', - }, + selectFilters[descriptionField] = { + value: selectValues, + key: descriptionField, + operator: isString(currentField) ? 'LIKE' : 'EQ', + entity: { + type: { + name: isString(currentField) + ? 'String' + : isNumber(currentField) + ? 'Int' + : isBoolean(currentField) + ? 'Boolean' + : 'DateTime', + kind: 'SCALAR', }, - }; - - let response = await requestEntity(current, url,/* 1, 10, selectFilters*/); - if (response && response.data) { - return response.data.data[current.queryAll]; - } + }, }; - fetch().then((data) => { - setResponseEntity(data); - }); + + let response = await requestEntity( + current, + url /* 1, 10, selectFilters*/ + ); + if (response && response.data) { + return response.data.data[current.queryAll]; + } + }; + fetch().then((data) => { + setResponseEntity(data); + }); //} // eslint-disable-next-line }, [selectValues]); @@ -172,7 +178,7 @@ export const SelectEntities = ({ ); }); return options; - + // eslint-disable-next-line }, [responseEntity]); // siempre se va a mandar el id como field en este tipo de conexion ? From fb51304102e330fa4588e178241d2197af6bd816 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 15 Dec 2021 11:56:11 -0300 Subject: [PATCH 06/60] adding deploy --- .github/workflows/github-actions.yml | 11 +++ package-lock.json | 125 +++++++++++++++++++++++++++ package.json | 5 +- 3 files changed, 140 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index e1dcffe..ef8a12d 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -39,3 +39,14 @@ jobs: run: npm run build --if-present - name: Job's status run: echo "🍏 This job's status is ${{ job.status }}." + - name: Deploy + run: | + git config --global user.name $user_name + git config --global user.email $user_email + git remote set-url origin https://${github_token}@github.com/${repository} + npm run deploy + env: + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' + github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} + repository: ${{ github.repository }} diff --git a/package-lock.json b/package-lock.json index 8668060..5bccc27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5007,6 +5007,11 @@ } } }, + "email-addresses": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/email-addresses/-/email-addresses-3.1.0.tgz", + "integrity": "sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==" + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -6258,6 +6263,21 @@ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", "optional": true }, + "filename-reserved-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz", + "integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik=" + }, + "filenamify": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-4.3.0.tgz", + "integrity": "sha512-hcFKyUG57yWGAzu1CMt/dPzYZuv+jAJUT85bL8mrXvNe6hWj6yEHEc4EdcgiA6Z3oi1/9wXJdZPXF2dZNgwgOg==", + "requires": { + "filename-reserved-regex": "^2.0.0", + "strip-outer": "^1.0.1", + "trim-repeated": "^1.0.0" + } + }, "filesize": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/filesize/-/filesize-6.0.1.tgz", @@ -6758,6 +6778,95 @@ "assert-plus": "^1.0.0" } }, + "gh-pages": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/gh-pages/-/gh-pages-3.2.3.tgz", + "integrity": "sha512-jA1PbapQ1jqzacECfjUaO9gV8uBgU6XNMV0oXLtfCX3haGLe5Atq8BxlrADhbD6/UdG9j6tZLWAkAybndOXTJg==", + "requires": { + "async": "^2.6.1", + "commander": "^2.18.0", + "email-addresses": "^3.0.1", + "filenamify": "^4.3.0", + "find-cache-dir": "^3.3.1", + "fs-extra": "^8.1.0", + "globby": "^6.1.0" + }, + "dependencies": { + "find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "requires": { + "p-locate": "^4.1.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "requires": { + "semver": "^6.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "requires": { + "p-limit": "^2.2.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "requires": { + "find-up": "^4.0.0" + } + } + } + }, "glob": { "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", @@ -14677,6 +14786,14 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, + "strip-outer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz", + "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==", + "requires": { + "escape-string-regexp": "^1.0.2" + } + }, "style-loader": { "version": "0.23.1", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.23.1.tgz", @@ -14963,6 +15080,14 @@ "punycode": "^2.1.0" } }, + "trim-repeated": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz", + "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=", + "requires": { + "escape-string-regexp": "^1.0.2" + } + }, "ts-loader": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-6.2.1.tgz", diff --git a/package.json b/package.json index 7d60e40..56cf69e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,9 @@ "lint": "eslint src/ --fix", "prettier": "prettier --single-quote --write src/", "prepare": "husky install", - "pre-commit": "lint-staged" + "pre-commit": "lint-staged", + "predeploy": "npm run build", + "deploy": "gh-pages -d build" }, "dependencies": { "antd": "^4.13.1", @@ -28,6 +30,7 @@ "babel-eslint": "^10.1.0", "direflow-component": "3.5.3", "direflow-scripts": "3.5.3", + "gh-pages": "^3.2.3", "react": "16.13.1", "react-dom": "16.13.1", "react-hook-form": "^7.4.0", From 17569c1d52466afa8c672ce3f2738a838e516eea Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 15 Dec 2021 12:04:40 -0300 Subject: [PATCH 07/60] adding homepage --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 56cf69e..7879d83 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "url": "https://github.com/simtlix/simfinity-web" }, "main": "build/direflowBundle.js", + "homepage": "https://myusername.github.io/my-app", "files": [ "build" ], From 9dca133a9ec226547737f7c0580ad06ccf137c24 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 15 Dec 2021 12:44:23 -0300 Subject: [PATCH 08/60] deleting homepage --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 7879d83..56cf69e 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,6 @@ "url": "https://github.com/simtlix/simfinity-web" }, "main": "build/direflowBundle.js", - "homepage": "https://myusername.github.io/my-app", "files": [ "build" ], From c99065dcb58735df0c475397e6234f528e989e56 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 4 Jan 2022 21:23:25 -0300 Subject: [PATCH 09/60] adding homepage --- package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 56cf69e..0fd0a58 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "version": "1.0.0", "author": "Multiscreen Technology Group - SimTLiX SRL", "license": "SEE LICENSE IN LICENSE", + "homepage": "https://simtlix.github.io/simfinity-web", "repository": { "type": "git", "url": "https://github.com/simtlix/simfinity-web" @@ -13,6 +14,8 @@ "build" ], "scripts": { + "predeploy": "npm run build", + "deploy": "gh-pages -d build", "start": "direflow-scripts start", "build": "direflow-scripts build", "build:lib": "direflow-scripts build:lib", @@ -20,9 +23,7 @@ "lint": "eslint src/ --fix", "prettier": "prettier --single-quote --write src/", "prepare": "husky install", - "pre-commit": "lint-staged", - "predeploy": "npm run build", - "deploy": "gh-pages -d build" + "pre-commit": "lint-staged" }, "dependencies": { "antd": "^4.13.1", From 122e82a2b7d5e3e1d41ed898db263abfe5e80cc3 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 4 Jan 2022 21:24:56 -0300 Subject: [PATCH 10/60] fix homepage --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0fd0a58..243f2da 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "1.0.0", "author": "Multiscreen Technology Group - SimTLiX SRL", "license": "SEE LICENSE IN LICENSE", - "homepage": "https://simtlix.github.io/simfinity-web", + "homepage": "https://simtlix.github.io/simfinity-web/", "repository": { "type": "git", "url": "https://github.com/simtlix/simfinity-web" From 79c81d2c4dbfbdd4bc9cebea2a8075117b91a7b9 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 4 Jan 2022 22:38:55 -0300 Subject: [PATCH 11/60] changes workflow --- .github/workflows/github-actions.yml | 29 +++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index ef8a12d..835f069 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -39,14 +39,21 @@ jobs: run: npm run build --if-present - name: Job's status run: echo "🍏 This job's status is ${{ job.status }}." - - name: Deploy - run: | - git config --global user.name $user_name - git config --global user.email $user_email - git remote set-url origin https://${github_token}@github.com/${repository} - npm run deploy - env: - user_name: 'github-actions[bot]' - user_email: 'github-actions[bot]@users.noreply.github.com' - github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} - repository: ${{ github.repository }} +deploy: + name: Deploy + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: production-files + path: ./build + + - name: Deploy to gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} + publish_dir: ./build From de935630db920f4e14844a0b5427fac1bb2a6387 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 4 Jan 2022 22:42:07 -0300 Subject: [PATCH 12/60] fix workflow --- .github/workflows/github-actions.yml | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 835f069..360cbbd 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -39,21 +39,21 @@ jobs: run: npm run build --if-present - name: Job's status run: echo "🍏 This job's status is ${{ job.status }}." -deploy: - name: Deploy - needs: build - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - - steps: - - name: Download artifact - uses: actions/download-artifact@v2 - with: - name: production-files - path: ./build + deploy: + name: Deploy + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: production-files + path: ./build - - name: Deploy to gh-pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} - publish_dir: ./build + - name: Deploy to gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} + publish_dir: ./build From dc1cbf23f78fa445481c80fc3f00440ae60a197b Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 4 Jan 2022 22:43:58 -0300 Subject: [PATCH 13/60] fix workflow --- .github/workflows/github-actions.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 360cbbd..4428bff 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -39,6 +39,11 @@ jobs: run: npm run build --if-present - name: Job's status run: echo "🍏 This job's status is ${{ job.status }}." + - name: Upload production-ready build files + uses: actions/upload-artifact@v2 + with: + name: production-files + path: ./build deploy: name: Deploy needs: build From 71ea06e50e2d960f750449f1587004eebcf7a720 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 4 Jan 2022 22:48:26 -0300 Subject: [PATCH 14/60] changes workflow --- .github/workflows/github-actions.yml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 4428bff..48a5791 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -39,26 +39,8 @@ jobs: run: npm run build --if-present - name: Job's status run: echo "🍏 This job's status is ${{ job.status }}." - - name: Upload production-ready build files - uses: actions/upload-artifact@v2 - with: - name: production-files - path: ./build - deploy: - name: Deploy - needs: build - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - - steps: - - name: Download artifact - uses: actions/download-artifact@v2 - with: - name: production-files - path: ./build - - - name: Deploy to gh-pages - uses: peaceiris/actions-gh-pages@v3 - with: + - name: Deploy + run: npm run deploy + env: github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} - publish_dir: ./build + repository: ${{ github.repository }} From 5865186b5f8e72b483b0743584fb55e23756f25b Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 19 Jan 2022 11:34:57 -0300 Subject: [PATCH 15/60] changes github-actions --- .github/workflows/github-actions.yml | 78 ++++++++++++++++------------ 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 48a5791..1b88e71 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -1,46 +1,58 @@ -name: GitHub Actions +name: Build & deploy + on: push: branches: [ main ] pull_request: branches: [ main ] + jobs: - Explore-GitHub-Actions: + build: + name: Build runs-on: ubuntu-latest strategy: matrix: node-version: [12.x, 14.x, 16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - + steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v2 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - name: Install dependencies - run: npm ci - - name: Run code style check - run: npm run lint - - name: Run code formatter - run: npm run prettier - - name: Build - run: npm run build --if-present - - name: Job's status - run: echo "🍏 This job's status is ${{ job.status }}." - - name: Deploy - run: npm run deploy - env: - github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} - repository: ${{ github.repository }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Install dependencies + run: npm ci + - name: Run code style check + run: npm run lint + - name: Run code formatter + run: npm run prettier + - name: Build + run: npm run build --if-present + - name: Upload production-ready build files + uses: actions/upload-artifact@v2 + with: + name: production-files + path: ./build + + deploy: + name: Deploy + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: production-files + path: ./build + + - name: Deploy to gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build \ No newline at end of file From da6a649afa3f669e5232e71a9503a27641a19ca0 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 19 Jan 2022 11:47:05 -0300 Subject: [PATCH 16/60] github actions --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 1b88e71..fd24b84 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -54,5 +54,5 @@ jobs: - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} publish_dir: ./build \ No newline at end of file From 29da83dce6a5975bc5dffdd626cecb783b336dcb Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Mon, 24 Jan 2022 10:38:42 -0300 Subject: [PATCH 17/60] create deploy folder --- .github/workflows/github-actions.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index fd24b84..710d85f 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -37,6 +37,13 @@ jobs: with: name: production-files path: ./build + - name: Create deploy folder + run: mkdir deploy + - name: Copy content from build folder to deploy folder + run: cp -r ./build/ ./deploy + run: cp -r ./public/ ./deploy + - name: Add script tag into index.html + run: sed -i '4 i ' ./deploy/index.html deploy: name: Deploy @@ -49,10 +56,10 @@ jobs: uses: actions/download-artifact@v2 with: name: production-files - path: ./build + path: ./deploy - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} - publish_dir: ./build \ No newline at end of file + publish_dir: ./deploy \ No newline at end of file From 49c8689e8c4f9cd6531bb0d31429727a675abb91 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Mon, 24 Jan 2022 10:42:25 -0300 Subject: [PATCH 18/60] fix yml --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 710d85f..b7eb323 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -41,7 +41,7 @@ jobs: run: mkdir deploy - name: Copy content from build folder to deploy folder run: cp -r ./build/ ./deploy - run: cp -r ./public/ ./deploy + - run: cp -r ./public/ ./deploy - name: Add script tag into index.html run: sed -i '4 i ' ./deploy/index.html From 7dc3dfe6731306da0486c7f205a4da90d89e7409 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 8 Feb 2022 18:02:39 -0300 Subject: [PATCH 19/60] changes yml --- .github/workflows/github-actions.yml | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index b7eb323..e9d4019 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -41,7 +41,8 @@ jobs: run: mkdir deploy - name: Copy content from build folder to deploy folder run: cp -r ./build/ ./deploy - - run: cp -r ./public/ ./deploy + - name: Copy content from public folder to deploy folder + run: cp -r ./public/ ./deploy - name: Add script tag into index.html run: sed -i '4 i ' ./deploy/index.html diff --git a/package.json b/package.json index 243f2da..110281a 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ ], "scripts": { "predeploy": "npm run build", - "deploy": "gh-pages -d build", + "deploy": "gh-pages -d deploy", "start": "direflow-scripts start", "build": "direflow-scripts build", "build:lib": "direflow-scripts build:lib", From 7a9f22b3de85858240d7e04218a29d23aa4141e5 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 8 Feb 2022 18:31:31 -0300 Subject: [PATCH 20/60] disable eslint --- src/direflow-components/App.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/direflow-components/App.js b/src/direflow-components/App.js index be3addf..0aa43df 100644 --- a/src/direflow-components/App.js +++ b/src/direflow-components/App.js @@ -38,6 +38,7 @@ const App = ({ url }) => { }, [url]); const handleClick = (entity, ind) => { + // eslint-disable-next-line setCurrentEntity(entity); setResultTitle( intl.formatMessage({ From 396d8611580c2b9acab3494290468f9a0de4c42b Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 8 Feb 2022 19:32:52 -0300 Subject: [PATCH 21/60] fix warning --- src/direflow-components/App.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/direflow-components/App.js b/src/direflow-components/App.js index 0aa43df..b209766 100644 --- a/src/direflow-components/App.js +++ b/src/direflow-components/App.js @@ -37,19 +37,21 @@ const App = ({ url }) => { }); }, [url]); - const handleClick = (entity, ind) => { - // eslint-disable-next-line - setCurrentEntity(entity); - setResultTitle( - intl.formatMessage({ - id: `entity.${entity.name}.plural`, - defaultMessage: `Resultados de ${entity.name}`, - }) - ); - setSelectedKey(ind.toString()); - }; const renderEntities = entities.map((entity, index) => ( - handleClick(entity, index)}> + { + // eslint-disable-next-line + setCurrentEntity(entity); + setResultTitle( + intl.formatMessage({ + id: `entity.${entity.name}.plural`, + defaultMessage: `Resultados de ${entity.name}`, + }) + ); + setSelectedKey(index.toString()); + }} + > Date: Wed, 9 Feb 2022 00:03:41 -0300 Subject: [PATCH 22/60] warning --- src/direflow-components/App.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/direflow-components/App.js b/src/direflow-components/App.js index 2c68041..40ee62a 100644 --- a/src/direflow-components/App.js +++ b/src/direflow-components/App.js @@ -36,9 +36,20 @@ const App = ({ url }) => { }, [url]); useEffect(() => { + const handleClick = (entity, ind) => { + setCurrentEntity(entity); + setResultTitle( + intl.formatMessage({ + id: `entity.${entity.name}.plural`, + defaultMessage: `Resultados de ${entity.name}`, + }) + ); + setSelectedKey(ind.toString()); + }; if (entities[0]?.name) { handleClick(entities[0], 0); } + // eslint-disable-next-line }, [entities]); const handleClick = (entity, ind) => { setCurrentEntity(entity); From 3cbf27ae65aa1924e24328f3a5d94b6c68c2b1b5 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Feb 2022 00:14:30 -0300 Subject: [PATCH 23/60] changes yml --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index e9d4019..102a22c 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -44,7 +44,7 @@ jobs: - name: Copy content from public folder to deploy folder run: cp -r ./public/ ./deploy - name: Add script tag into index.html - run: sed -i '4 i ' ./deploy/index.html + run: sed -i '4 i ' './deploy/index.html' deploy: name: Deploy From 18c2286f9e13dfcf4ea18b700fd1f0cfcabc4ec6 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Feb 2022 00:40:18 -0300 Subject: [PATCH 24/60] changes yml --- .github/workflows/github-actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 102a22c..e2be0aa 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -40,9 +40,9 @@ jobs: - name: Create deploy folder run: mkdir deploy - name: Copy content from build folder to deploy folder - run: cp -r ./build/ ./deploy + run: cp -r ./build/. ./deploy - name: Copy content from public folder to deploy folder - run: cp -r ./public/ ./deploy + run: cp -r ./public/. ./deploy - name: Add script tag into index.html run: sed -i '4 i ' './deploy/index.html' From a7496ca7fb11f316af3d667c1a44c4a20fb9b7fb Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Feb 2022 09:14:37 -0300 Subject: [PATCH 25/60] changing deploy step --- .github/workflows/github-actions.yml | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index e2be0aa..e93ae97 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -45,22 +45,8 @@ jobs: run: cp -r ./public/. ./deploy - name: Add script tag into index.html run: sed -i '4 i ' './deploy/index.html' - - deploy: - name: Deploy - needs: build - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - - steps: - - name: Download artifact - uses: actions/download-artifact@v2 - with: - name: production-files - path: ./deploy - - - name: Deploy to gh-pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} - publish_dir: ./deploy \ No newline at end of file + - name: deploy to gh-pages + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} + publish_dir: ./deploy \ No newline at end of file From 4818ca5b25bf6abfc076d731c7beb1e0a6c97092 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Feb 2022 09:30:19 -0300 Subject: [PATCH 26/60] fix yml --- .github/workflows/github-actions.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index e93ae97..c1edbbb 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -45,8 +45,8 @@ jobs: run: cp -r ./public/. ./deploy - name: Add script tag into index.html run: sed -i '4 i ' './deploy/index.html' - - name: deploy to gh-pages - uses: peaceiris/actions-gh-pages@v3 - with: - deploy_key: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} - publish_dir: ./deploy \ No newline at end of file + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} + publish_dir: ./deploy \ No newline at end of file From 815b4aafb9b169341fc470f2cc25757bdd6c9b61 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Feb 2022 09:42:01 -0300 Subject: [PATCH 27/60] change step name --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index c1edbbb..dea76bb 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -45,7 +45,7 @@ jobs: run: cp -r ./public/. ./deploy - name: Add script tag into index.html run: sed -i '4 i ' './deploy/index.html' - - name: Deploy + - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} From 4e639ca21f1c4434b472993b17087b89589d335b Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Feb 2022 11:52:00 -0300 Subject: [PATCH 28/60] deleting pr delpoy --- .github/workflows/github-actions.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index dea76bb..82d5dea 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -3,8 +3,6 @@ name: Build & deploy on: push: branches: [ main ] - pull_request: - branches: [ main ] jobs: build: From 0ad79960e7faf0bcaec1e88eecad8f819f58b405 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Feb 2022 11:58:01 -0300 Subject: [PATCH 29/60] adding comments --- src/direflow-components/App.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/direflow-components/App.js b/src/direflow-components/App.js index 40ee62a..adfb948 100644 --- a/src/direflow-components/App.js +++ b/src/direflow-components/App.js @@ -36,6 +36,7 @@ const App = ({ url }) => { }, [url]); useEffect(() => { + // usar useCallBack const handleClick = (entity, ind) => { setCurrentEntity(entity); setResultTitle( From 6758908884849339069e1a2bdc5b4514a7388ebc Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 15 Feb 2022 15:28:39 -0300 Subject: [PATCH 30/60] creating deployment job --- .github/workflows/github-actions.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 82d5dea..9fee596 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -3,6 +3,8 @@ name: Build & deploy on: push: branches: [ main ] + pull_request: + branches: [ main ] jobs: build: @@ -43,8 +45,25 @@ jobs: run: cp -r ./public/. ./deploy - name: Add script tag into index.html run: sed -i '4 i ' './deploy/index.html' + - name: Upload production-ready build files + uses: actions/upload-artifact@v2 + with: + name: production-files + path: ./deploy + deploy: + name: Deploy + needs: build + runs-on: ubuntu-latest + + steps: + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: production-files + path: ./deploy + - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./deploy \ No newline at end of file From 18be34880feef2846885df4792476658971a246c Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 15 Feb 2022 15:37:15 -0300 Subject: [PATCH 31/60] fix secret name --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 9fee596..518735f 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -65,5 +65,5 @@ jobs: - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} publish_dir: ./deploy \ No newline at end of file From c95631759f52f7250c9b6290745e2ec60fe47320 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 15 Feb 2022 16:02:42 -0300 Subject: [PATCH 32/60] changes yml --- .github/workflows/github-actions.yml | 3 +-- src/direflow-components/App.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 518735f..4788820 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -50,18 +50,17 @@ jobs: with: name: production-files path: ./deploy + deploy: name: Deploy needs: build runs-on: ubuntu-latest - steps: - name: Download artifact uses: actions/download-artifact@v2 with: name: production-files path: ./deploy - - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@v3 with: diff --git a/src/direflow-components/App.js b/src/direflow-components/App.js index adfb948..80f3e4c 100644 --- a/src/direflow-components/App.js +++ b/src/direflow-components/App.js @@ -130,7 +130,7 @@ const App = ({ url }) => { > )} -
Simtlix ©2021
+
Simtlix ©2022
From 820f20cbe8480b0969f3253ef8d2388fea131c83 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 15 Feb 2022 16:11:36 -0300 Subject: [PATCH 33/60] undo test --- src/direflow-components/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/direflow-components/App.js b/src/direflow-components/App.js index 80f3e4c..adfb948 100644 --- a/src/direflow-components/App.js +++ b/src/direflow-components/App.js @@ -130,7 +130,7 @@ const App = ({ url }) => { > )} -
Simtlix ©2022
+
Simtlix ©2021
From c72d69b022e1a8d4f8de8ef8ec659cbe22b30f7a Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 2 Mar 2022 10:34:20 -0300 Subject: [PATCH 34/60] avoid deploy when pull request is created --- .github/workflows/github-actions.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 4788820..1673dfc 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -3,8 +3,6 @@ name: Build & deploy on: push: branches: [ main ] - pull_request: - branches: [ main ] jobs: build: From 11b556000024558a669b1a93114b5f2d1b397e88 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 2 Mar 2022 11:07:41 -0300 Subject: [PATCH 35/60] code clean --- .github/workflows/github-actions.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 1673dfc..20f0feb 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -12,7 +12,6 @@ jobs: strategy: matrix: node-version: [12.x, 14.x, 16.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - name: Checkout code From 48ea2bb368cfc0bd5cf75cf063c6dbb84a8429aa Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 2 Mar 2022 11:57:11 -0300 Subject: [PATCH 36/60] adding subdirectory --- .github/workflows/github-actions.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 20f0feb..0a4bb61 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -3,6 +3,8 @@ name: Build & deploy on: push: branches: [ main ] + pull_request: + branches: [ main ] jobs: build: @@ -12,6 +14,7 @@ jobs: strategy: matrix: node-version: [12.x, 14.x, 16.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - name: Checkout code @@ -62,4 +65,5 @@ jobs: uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} - publish_dir: ./deploy \ No newline at end of file + publish_dir: ./deploy + destination_dir: main \ No newline at end of file From c7f561f0a5e6720bbccf5842c8fbf2837a8007d6 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 8 Mar 2022 23:52:34 -0300 Subject: [PATCH 37/60] extract branch name --- .github/workflows/github-actions.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 0a4bb61..a9a411f 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -51,6 +51,25 @@ jobs: name: production-files path: ./deploy + which_branch: + runs-on: ubuntu-latest + steps: + # extract branch name + - name: Extract branch name + if: github.event_name != 'pull_request' + shell: bash + run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + + # extract branch name on pull request + - name: Print branch name + if: github.event_name == 'pull_request' + run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_HEAD_REF})" + + # print branch name + - name: Get branch name + run: echo 'The branch name is' $BRANCH_NAME + deploy: name: Deploy needs: build From 3f5f6876d0711ebd86fc125f8be038acee533d03 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Mar 2022 00:05:32 -0300 Subject: [PATCH 38/60] fix --- .github/workflows/github-actions.yml | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index a9a411f..b79c72e 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -50,25 +50,8 @@ jobs: with: name: production-files path: ./deploy - - which_branch: - runs-on: ubuntu-latest - steps: - # extract branch name - - name: Extract branch name - if: github.event_name != 'pull_request' - shell: bash - run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - # extract branch name on pull request - - name: Print branch name - if: github.event_name == 'pull_request' - run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_HEAD_REF})" - - # print branch name - - name: Get branch name - run: echo 'The branch name is' $BRANCH_NAME + - name: Branch name + run: echo running on branch ${GITHUB_REF##*/} deploy: name: Deploy From cb89b77a91353d0137648554a579b24ce997c882 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Mar 2022 00:24:34 -0300 Subject: [PATCH 39/60] fix --- .github/workflows/github-actions.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index b79c72e..7e2ba01 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -51,6 +51,9 @@ jobs: name: production-files path: ./deploy - name: Branch name + run: echo running on branch ${GITHUB_REF} + run: echo running on branch ${GITHUB_REF#refs/*/} + run: echo running on branch ${GITHUB_REF#refs/heads/} run: echo running on branch ${GITHUB_REF##*/} deploy: From 68bffdee0b1ef81827c76b6368a74885ae024178 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Mar 2022 00:27:24 -0300 Subject: [PATCH 40/60] fix yml --- .github/workflows/github-actions.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 7e2ba01..472b7cc 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -52,9 +52,9 @@ jobs: path: ./deploy - name: Branch name run: echo running on branch ${GITHUB_REF} - run: echo running on branch ${GITHUB_REF#refs/*/} - run: echo running on branch ${GITHUB_REF#refs/heads/} - run: echo running on branch ${GITHUB_REF##*/} + - run: echo running on branch ${GITHUB_REF#refs/*/} + - run: echo running on branch ${GITHUB_REF#refs/heads/} + - run: echo running on branch ${GITHUB_REF##*/} deploy: name: Deploy From a0609f610de41ee5cc7be06ea6ff6e4ceb77f795 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Mar 2022 09:30:38 -0300 Subject: [PATCH 41/60] changes extract branch name --- .github/workflows/github-actions.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 472b7cc..10ad7bf 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -51,10 +51,13 @@ jobs: name: production-files path: ./deploy - name: Branch name - run: echo running on branch ${GITHUB_REF} + run: echo running on branch ${GITHUB_HEAD_REF} - run: echo running on branch ${GITHUB_REF#refs/*/} - run: echo running on branch ${GITHUB_REF#refs/heads/} - run: echo running on branch ${GITHUB_REF##*/} + - uses: nelonoel/branch-name@v1 + # Use branch name for whatever purpose + - run: echo ${BRANCH_NAME} deploy: name: Deploy From d4bea920112ce20191c762c31181b282eced528c Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Mar 2022 09:56:08 -0300 Subject: [PATCH 42/60] adding branch name logic --- .github/workflows/github-actions.yml | 31 +++++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 10ad7bf..be2d6e6 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -50,20 +50,35 @@ jobs: with: name: production-files path: ./deploy - - name: Branch name - run: echo running on branch ${GITHUB_HEAD_REF} - - run: echo running on branch ${GITHUB_REF#refs/*/} - - run: echo running on branch ${GITHUB_REF#refs/heads/} - - run: echo running on branch ${GITHUB_REF##*/} - - uses: nelonoel/branch-name@v1 - # Use branch name for whatever purpose - - run: echo ${BRANCH_NAME} deploy: name: Deploy needs: build runs-on: ubuntu-latest steps: + - name: Branch name + run: echo running on branch ${GITHUB_HEAD_REF} + - run: echo running on branch ${GITHUB_REF#refs/*/} + - run: echo running on branch ${GITHUB_REF#refs/heads/} + - run: echo running on branch ${GITHUB_REF##*/} + - run: echo "branch_name=${GITHUB_REF#refs/heads/}" + - run: echo "branch_name=${GITHUB_HEAD_REF}" + + # extract branch name + - name: Extract branch name + if: github.event_name != 'pull_request' + shell: bash + run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + id: extract_branch + + # extract branch name on pull request + - name: Print branch name + if: github.event_name == 'pull_request' + run: echo "branch_name=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + + # print branch name + - name: Get branch name + run: echo "${{ env.branch_name }}" # This will output the branch name - name: Download artifact uses: actions/download-artifact@v2 with: From 9c5fafd37ef5f8ed3974b099fda516b0b1fb62d6 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Mar 2022 11:01:22 -0300 Subject: [PATCH 43/60] set branch name --- .github/workflows/github-actions.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index be2d6e6..35688da 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -63,12 +63,12 @@ jobs: - run: echo running on branch ${GITHUB_REF##*/} - run: echo "branch_name=${GITHUB_REF#refs/heads/}" - run: echo "branch_name=${GITHUB_HEAD_REF}" - + # extract branch name - name: Extract branch name if: github.event_name != 'pull_request' shell: bash - run: echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + run: echo "branch_name=" >> $GITHUB_ENV id: extract_branch # extract branch name on pull request @@ -89,4 +89,4 @@ jobs: with: github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} publish_dir: ./deploy - destination_dir: main \ No newline at end of file + destination_dir: branch_name \ No newline at end of file From 4ef2c23db0ae0e164f3b0c0dae981885d40e3eb9 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Mar 2022 11:10:34 -0300 Subject: [PATCH 44/60] fix --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 35688da..e236668 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -89,4 +89,4 @@ jobs: with: github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} publish_dir: ./deploy - destination_dir: branch_name \ No newline at end of file + destination_dir: ${branch_name} \ No newline at end of file From 999c03474b3fbf2de3a297d21060745b35f7d30e Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 9 Mar 2022 11:33:52 -0300 Subject: [PATCH 45/60] fix env var --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index e236668..b7b2290 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -89,4 +89,4 @@ jobs: with: github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} publish_dir: ./deploy - destination_dir: ${branch_name} \ No newline at end of file + destination_dir: ${{ env.branch_name }} \ No newline at end of file From e6a9319b8b80add37d7d761cceabad74d7e8af4f Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 16 Mar 2022 09:34:08 -0300 Subject: [PATCH 46/60] testing main deploy --- .github/workflows/github-actions.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index b7b2290..7cc44d3 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -58,8 +58,11 @@ jobs: steps: - name: Branch name run: echo running on branch ${GITHUB_HEAD_REF} + - run: echo running on branch ${GITHUB_REF#refs} - run: echo running on branch ${GITHUB_REF#refs/*/} - run: echo running on branch ${GITHUB_REF#refs/heads/} + - run: echo running on branch ${GITHUB_REF#refs/heads/*/} + - run: echo running on branch ${GITHUB_REF##*/} - run: echo running on branch ${GITHUB_REF##*/} - run: echo "branch_name=${GITHUB_REF#refs/heads/}" - run: echo "branch_name=${GITHUB_HEAD_REF}" @@ -74,7 +77,7 @@ jobs: # extract branch name on pull request - name: Print branch name if: github.event_name == 'pull_request' - run: echo "branch_name=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + run: echo "branch_name=" >> $GITHUB_ENV # print branch name - name: Get branch name From e072922e44ab25977818299964c179de57fcd38b Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 16 Mar 2022 09:49:38 -0300 Subject: [PATCH 47/60] testing main deploy --- .github/workflows/github-actions.yml | 3 --- src/direflow-components/App.js | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 7cc44d3..f8cbbed 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -58,11 +58,8 @@ jobs: steps: - name: Branch name run: echo running on branch ${GITHUB_HEAD_REF} - - run: echo running on branch ${GITHUB_REF#refs} - run: echo running on branch ${GITHUB_REF#refs/*/} - run: echo running on branch ${GITHUB_REF#refs/heads/} - - run: echo running on branch ${GITHUB_REF#refs/heads/*/} - - run: echo running on branch ${GITHUB_REF##*/} - run: echo running on branch ${GITHUB_REF##*/} - run: echo "branch_name=${GITHUB_REF#refs/heads/}" - run: echo "branch_name=${GITHUB_HEAD_REF}" diff --git a/src/direflow-components/App.js b/src/direflow-components/App.js index adfb948..80f3e4c 100644 --- a/src/direflow-components/App.js +++ b/src/direflow-components/App.js @@ -130,7 +130,7 @@ const App = ({ url }) => { > )} -
Simtlix ©2021
+
Simtlix ©2022
From e733fa5a86473827b2bbf80e25548b906f874b75 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 16 Mar 2022 14:21:07 -0300 Subject: [PATCH 48/60] undo test --- .github/workflows/github-actions.yml | 2 +- src/direflow-components/App.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index f8cbbed..bbbbdd1 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -74,7 +74,7 @@ jobs: # extract branch name on pull request - name: Print branch name if: github.event_name == 'pull_request' - run: echo "branch_name=" >> $GITHUB_ENV + run: echo "branch_name=${GITHUB_REF#refs}" >> $GITHUB_ENV # print branch name - name: Get branch name diff --git a/src/direflow-components/App.js b/src/direflow-components/App.js index 80f3e4c..adfb948 100644 --- a/src/direflow-components/App.js +++ b/src/direflow-components/App.js @@ -130,7 +130,7 @@ const App = ({ url }) => { > )} -
Simtlix ©2022
+
Simtlix ©2021
From a278f46aeb83a9ea2a9ba4d1f89e97265f7c6f23 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 22 Mar 2022 17:47:35 -0300 Subject: [PATCH 49/60] delete deployments --- .github/workflows/github-actions.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index bbbbdd1..c04f641 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -51,6 +51,15 @@ jobs: name: production-files path: ./deploy + delete: + runs-on: ubuntu-latest + steps: + - uses: strumwolf/delete-deployment-environment@v2 + with: + token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} + environment: github-pages + onlyRemoveDeployments: true + deploy: name: Deploy needs: build From 2dc8d5dc7d2f38e6cfc2085c83d4dc6ced949599 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Tue, 22 Mar 2022 17:51:31 -0300 Subject: [PATCH 50/60] fix branch name --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index c04f641..47f3529 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -83,7 +83,7 @@ jobs: # extract branch name on pull request - name: Print branch name if: github.event_name == 'pull_request' - run: echo "branch_name=${GITHUB_REF#refs}" >> $GITHUB_ENV + run: echo "branch_name=${GITHUB_HEAD_REF}" >> $GITHUB_ENV # print branch name - name: Get branch name From 04badec795bef021a74149aa17106b57fd3504a3 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 23 Mar 2022 11:27:10 -0300 Subject: [PATCH 51/60] set url --- .github/workflows/github-actions.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 47f3529..88ad364 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -64,6 +64,9 @@ jobs: name: Deploy needs: build runs-on: ubuntu-latest + environment: + name: github-pages + url: https://simtlix.github.io/simfinity-web/${{ env.branch_name }} steps: - name: Branch name run: echo running on branch ${GITHUB_HEAD_REF} From f164d7132a04b5f58bb9ca815128f36ce4cb1b36 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Mon, 28 Mar 2022 14:16:53 -0300 Subject: [PATCH 52/60] adding artifact name depending on the branch --- .github/workflows/github-actions.yml | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 88ad364..88a4ecf 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -32,11 +32,6 @@ jobs: run: npm run prettier - name: Build run: npm run build --if-present - - name: Upload production-ready build files - uses: actions/upload-artifact@v2 - with: - name: production-files - path: ./build - name: Create deploy folder run: mkdir deploy - name: Copy content from build folder to deploy folder @@ -45,20 +40,18 @@ jobs: run: cp -r ./public/. ./deploy - name: Add script tag into index.html run: sed -i '4 i ' './deploy/index.html' - - name: Upload production-ready build files + - name: Upload production-ready build files on main branch + if: github.event_name != 'pull_request' uses: actions/upload-artifact@v2 with: name: production-files path: ./deploy - - delete: - runs-on: ubuntu-latest - steps: - - uses: strumwolf/delete-deployment-environment@v2 - with: - token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} - environment: github-pages - onlyRemoveDeployments: true + - name: Upload production-ready build files on pull_request + if: github.event_name == 'pull_request' + uses: actions/upload-artifact@v2 + with: + name: pull-request-files + path: ./deploy deploy: name: Deploy @@ -91,11 +84,18 @@ jobs: # print branch name - name: Get branch name run: echo "${{ env.branch_name }}" # This will output the branch name - - name: Download artifact + - name: Download artifact on main branch + if: github.event_name != 'pull_request' uses: actions/download-artifact@v2 with: name: production-files path: ./deploy + - name: Download artifact on pull_request + if: github.event_name == 'pull_request' + uses: actions/download-artifact@v2 + with: + name: pull-request-files + path: ./deploy - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@v3 with: From 857ac63978f537eaf3010c055dca7b5798ce0b8b Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Mon, 28 Mar 2022 15:21:15 -0300 Subject: [PATCH 53/60] deleting artifacts --- .github/workflows/github-actions.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 88a4ecf..4af5047 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -52,6 +52,17 @@ jobs: with: name: pull-request-files path: ./deploy + + delete-artifacts: + name: Delete Artifacts + runs-on: ubuntu-latest + steps: + - uses: kolpav/purge-artifacts-action@v1 + with: + token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} + expire-in: 7days # Setting this to 0 will delete all artifacts + onlyPrefix: pull-request + exceptPrefix: production deploy: name: Deploy From 26ab024211a68415c81d29665272f7233d66a25a Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Mon, 28 Mar 2022 15:50:33 -0300 Subject: [PATCH 54/60] code clean --- .github/workflows/github-actions.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 4af5047..28a7af0 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -14,7 +14,6 @@ jobs: strategy: matrix: node-version: [12.x, 14.x, 16.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - name: Checkout code @@ -60,9 +59,8 @@ jobs: - uses: kolpav/purge-artifacts-action@v1 with: token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} - expire-in: 7days # Setting this to 0 will delete all artifacts + expire-in: 0days onlyPrefix: pull-request - exceptPrefix: production deploy: name: Deploy @@ -74,21 +72,15 @@ jobs: steps: - name: Branch name run: echo running on branch ${GITHUB_HEAD_REF} - - run: echo running on branch ${GITHUB_REF#refs/*/} - - run: echo running on branch ${GITHUB_REF#refs/heads/} - - run: echo running on branch ${GITHUB_REF##*/} - - run: echo "branch_name=${GITHUB_REF#refs/heads/}" - - run: echo "branch_name=${GITHUB_HEAD_REF}" - # extract branch name - - name: Extract branch name + # extract branch name on main branch + - name: Extract branch name on main branch if: github.event_name != 'pull_request' - shell: bash run: echo "branch_name=" >> $GITHUB_ENV id: extract_branch # extract branch name on pull request - - name: Print branch name + - name: Extract branch name on pull request if: github.event_name == 'pull_request' run: echo "branch_name=${GITHUB_HEAD_REF}" >> $GITHUB_ENV From 92f277e4f42cd7131984978ec66ee581fa7f0e68 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Mon, 28 Mar 2022 16:02:26 -0300 Subject: [PATCH 55/60] deleting optional arguments --- .github/workflows/github-actions.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 28a7af0..f1be865 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -60,7 +60,6 @@ jobs: with: token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} expire-in: 0days - onlyPrefix: pull-request deploy: name: Deploy From a6063913a2e1e7e621474133fde1a64afc0bbea8 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 30 Mar 2022 10:47:12 -0300 Subject: [PATCH 56/60] changes --- .github/workflows/github-actions.yml | 29 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index f1be865..cc86ce4 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -51,15 +51,6 @@ jobs: with: name: pull-request-files path: ./deploy - - delete-artifacts: - name: Delete Artifacts - runs-on: ubuntu-latest - steps: - - uses: kolpav/purge-artifacts-action@v1 - with: - token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} - expire-in: 0days deploy: name: Deploy @@ -73,13 +64,13 @@ jobs: run: echo running on branch ${GITHUB_HEAD_REF} # extract branch name on main branch - - name: Extract branch name on main branch + - name: Save branch name on main branch if: github.event_name != 'pull_request' - run: echo "branch_name=" >> $GITHUB_ENV + run: echo "branch_name=${GITHUB_HEAD_REF}" >> $GITHUB_ENV id: extract_branch # extract branch name on pull request - - name: Extract branch name on pull request + - name: Save branch name on pull request if: github.event_name == 'pull_request' run: echo "branch_name=${GITHUB_HEAD_REF}" >> $GITHUB_ENV @@ -98,9 +89,19 @@ jobs: with: name: pull-request-files path: ./deploy - - name: Deploy to gh-pages + - name: Deploy to gh-pages on main branch + if: github.event_name != 'pull_request' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} + publish_dir: ./deploy + destination_dir: ${{ env.branch_name }} + keep_files: true + - name: Deploy to gh-pages on pull_request + if: github.event_name == 'pull_request' uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }} publish_dir: ./deploy - destination_dir: ${{ env.branch_name }} \ No newline at end of file + destination_dir: ${{ env.branch_name }} + keep_files: false \ No newline at end of file From 70880fbf300967b04deab837f39e2a3561104f6f Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 30 Mar 2022 10:55:27 -0300 Subject: [PATCH 57/60] fix branch name on pr --- .github/workflows/github-actions.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index cc86ce4..c5ea031 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -60,23 +60,18 @@ jobs: name: github-pages url: https://simtlix.github.io/simfinity-web/${{ env.branch_name }} steps: - - name: Branch name - run: echo running on branch ${GITHUB_HEAD_REF} - # extract branch name on main branch + # save branch name on main branch - name: Save branch name on main branch if: github.event_name != 'pull_request' run: echo "branch_name=${GITHUB_HEAD_REF}" >> $GITHUB_ENV id: extract_branch - # extract branch name on pull request + # save branch name on pull request - name: Save branch name on pull request if: github.event_name == 'pull_request' - run: echo "branch_name=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + run: echo "branch_name=${{github.event.number}}" >> $GITHUB_ENV - # print branch name - - name: Get branch name - run: echo "${{ env.branch_name }}" # This will output the branch name - name: Download artifact on main branch if: github.event_name != 'pull_request' uses: actions/download-artifact@v2 From 2adbb09dbd05fc99d52ed4b05db0f486947f44de Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 30 Mar 2022 10:59:54 -0300 Subject: [PATCH 58/60] fix name branch --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index c5ea031..dedb3d7 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -70,7 +70,7 @@ jobs: # save branch name on pull request - name: Save branch name on pull request if: github.event_name == 'pull_request' - run: echo "branch_name=${{github.event.number}}" >> $GITHUB_ENV + run: echo "branch_name=pr${{github.event.number}}" >> $GITHUB_ENV - name: Download artifact on main branch if: github.event_name != 'pull_request' From a18ff6186e8f03c1f00532c1151d3934987409b2 Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 30 Mar 2022 11:11:39 -0300 Subject: [PATCH 59/60] test name branch --- .github/workflows/github-actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index dedb3d7..dfbb1e2 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -64,13 +64,13 @@ jobs: # save branch name on main branch - name: Save branch name on main branch if: github.event_name != 'pull_request' - run: echo "branch_name=${GITHUB_HEAD_REF}" >> $GITHUB_ENV + run: echo "branch_name=${{ github.head_ref }}" >> $GITHUB_ENV id: extract_branch # save branch name on pull request - name: Save branch name on pull request if: github.event_name == 'pull_request' - run: echo "branch_name=pr${{github.event.number}}" >> $GITHUB_ENV + run: echo "branch_name=${{ github.head_ref }}" >> $GITHUB_ENV - name: Download artifact on main branch if: github.event_name != 'pull_request' From 5ecadba9d52307d785dd1a9431a44402761b1d7e Mon Sep 17 00:00:00 2001 From: Joel Molina Date: Wed, 30 Mar 2022 11:16:26 -0300 Subject: [PATCH 60/60] . --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index dfbb1e2..461553b 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -61,7 +61,7 @@ jobs: url: https://simtlix.github.io/simfinity-web/${{ env.branch_name }} steps: - # save branch name on main branch + # save branch name on main branch. - name: Save branch name on main branch if: github.event_name != 'pull_request' run: echo "branch_name=${{ github.head_ref }}" >> $GITHUB_ENV