From 0356f077ffbce5763ee4a1f620087fbd54181460 Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 15:02:43 +0200 Subject: [PATCH 01/12] Create node.js.yml --- .github/workflows/node.js.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..abfbe33 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,36 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Compile & Push + +on: + push: + branches: [ master ] + workflow_dispatch: + repository_dispatch: + types: + - webhook + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - run: git pull --recursive-submodules=yes + - run: yarn + - run: TCGDEX_COMPILER_LANG=en yarn start + - run: TCGDEX_COMPILER_LANG=fr yarn start + - run: cd dist && git commit -m "Updated Database" + - run: git push --recursive-submodules=on-demand + - run: yarn upload From c93a03d9e1421c31bc1b0b408ded634725d7490d Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 15:04:27 +0200 Subject: [PATCH 02/12] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index abfbe33..54df5db 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -27,7 +27,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - - run: git pull --recursive-submodules=yes + - run: git pull --recurse-submodules=yes - run: yarn - run: TCGDEX_COMPILER_LANG=en yarn start - run: TCGDEX_COMPILER_LANG=fr yarn start From 2e81f2be072d7211be6478ba356c5a021a410244 Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 15:27:59 +0200 Subject: [PATCH 03/12] Update node.js.yml --- .github/workflows/node.js.yml | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 54df5db..a305274 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,21 +16,34 @@ jobs: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [14.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: - node-version: ${{ matrix.node-version }} + node-version: 14.x + + - name: Pull & Install - run: git pull --recurse-submodules=yes - - run: yarn + - run: yarn db:compile + + - name: Compile & Upload - run: TCGDEX_COMPILER_LANG=en yarn start - run: TCGDEX_COMPILER_LANG=fr yarn start - - run: cd dist && git commit -m "Updated Database" - - run: git push --recursive-submodules=on-demand - run: yarn upload + env: + UPLOAD_REMOTE: ${{ secrets.UPLOAD_REMOTE }} + UPLOAD_DIST: ${{ secrets.UPLOAD_DIST }} + UPLOAD_USERNAME: ${{ secrets.UPLOAD_USERNAME }} + UPLOAD_PASSWORD: ${{ secrets.UPLOAD_PASSWORD }} + + - name: Commit changes + - run: git config --local user.email "bot@tcgdex.net" + - run: git config --local user.name "TCGdex [bot]" + - run: cd dist && git commit -m "Updated Database" -a && cd ../ + + - name: Push changes + - uses: ad-m/github-push-action@master + - with: + github_token: ${{ secrets.UPLOAD_TOKEN }} + directory: './dist' From de9a96789c0249d7d830d048facf823011ac9d9f Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 15:31:49 +0200 Subject: [PATCH 04/12] Update node.js.yml --- .github/workflows/node.js.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index a305274..636e819 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -18,30 +18,23 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} + - name: Compile & Upload uses: actions/setup-node@v2 with: node-version: 14.x - - - name: Pull & Install - run: git pull --recurse-submodules=yes - run: yarn db:compile - - - name: Compile & Upload - run: TCGDEX_COMPILER_LANG=en yarn start - run: TCGDEX_COMPILER_LANG=fr yarn start - run: yarn upload + - run: git config --local user.email "bot@tcgdex.net" + - run: git config --local user.name "TCGdex [bot]" + - run: cd dist && git commit -m "Updated Database" -a && cd ../ env: UPLOAD_REMOTE: ${{ secrets.UPLOAD_REMOTE }} UPLOAD_DIST: ${{ secrets.UPLOAD_DIST }} UPLOAD_USERNAME: ${{ secrets.UPLOAD_USERNAME }} UPLOAD_PASSWORD: ${{ secrets.UPLOAD_PASSWORD }} - - - name: Commit changes - - run: git config --local user.email "bot@tcgdex.net" - - run: git config --local user.name "TCGdex [bot]" - - run: cd dist && git commit -m "Updated Database" -a && cd ../ - - name: Push changes - uses: ad-m/github-push-action@master - with: From 6ebad2fc0e6eaa108abbd7a924aa801caf91224f Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 15:39:59 +0200 Subject: [PATCH 05/12] Update node.js.yml --- .github/workflows/node.js.yml | 36 ++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 636e819..00dfbe1 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -13,30 +13,40 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Compile & Upload + + - name: Setup NodeJS uses: actions/setup-node@v2 with: - node-version: 14.x - - run: git pull --recurse-submodules=yes - - run: yarn db:compile - - run: TCGDEX_COMPILER_LANG=en yarn start - - run: TCGDEX_COMPILER_LANG=fr yarn start - - run: yarn upload - - run: git config --local user.email "bot@tcgdex.net" - - run: git config --local user.name "TCGdex [bot]" - - run: cd dist && git commit -m "Updated Database" -a && cd ../ + node-version: '14.x' + + - name: Pull submodules + run: git pull --recurse-submodules=yes + + - name: Compile Database + run: yarn db:compile + + - name: Build + run: yarn start && TCGDEX_COMPILER_LANG=fr yarn start + + - name: Upload + run: yarn upload + + - name: Commit Changes + run: | + git config --local user.email "bot@tcgdex.net" + git config --local user.name "TCGdex [bot]" + cd dist && git commit -m "Updated Database" -a && cd ../ env: UPLOAD_REMOTE: ${{ secrets.UPLOAD_REMOTE }} UPLOAD_DIST: ${{ secrets.UPLOAD_DIST }} UPLOAD_USERNAME: ${{ secrets.UPLOAD_USERNAME }} UPLOAD_PASSWORD: ${{ secrets.UPLOAD_PASSWORD }} - name: Push changes - - uses: ad-m/github-push-action@master - - with: + uses: ad-m/github-push-action@master + with: github_token: ${{ secrets.UPLOAD_TOKEN }} directory: './dist' From 15ccf6716fba1d017b47ee1e35fd94739538c585 Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 15:42:25 +0200 Subject: [PATCH 06/12] Update node.js.yml --- .github/workflows/node.js.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 00dfbe1..42ce87a 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -24,7 +24,10 @@ jobs: node-version: '14.x' - name: Pull submodules - run: git pull --recurse-submodules=yes + run: | + cd db && git pull + cd ../dist && git pull + cd ../ - name: Compile Database run: yarn db:compile From 3d561b400dcb72ba16cce39019584f9378ae116f Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 15:45:37 +0200 Subject: [PATCH 07/12] Update node.js.yml --- .github/workflows/node.js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 42ce87a..b093d9a 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -30,10 +30,10 @@ jobs: cd ../ - name: Compile Database - run: yarn db:compile + run: cd db && yarn && yarn compile && cd ../ - name: Build - run: yarn start && TCGDEX_COMPILER_LANG=fr yarn start + run: yarn && yarn start && TCGDEX_COMPILER_LANG=fr yarn start - name: Upload run: yarn upload From a17c1e317109fa8e90bc085d3d7bf05aa24adc99 Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 15:50:13 +0200 Subject: [PATCH 08/12] Update node.js.yml --- .github/workflows/node.js.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index b093d9a..9baf500 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -23,26 +23,27 @@ jobs: with: node-version: '14.x' - - name: Pull submodules - run: | - cd db && git pull - cd ../dist && git pull - cd ../ + - name: Pull Distribution + working-directory: ./db + run: git pull - name: Compile Database - run: cd db && yarn && yarn compile && cd ../ + working-directory: ./db + run: git pull && yarn && yarn compile - name: Build + working-directory: ./ run: yarn && yarn start && TCGDEX_COMPILER_LANG=fr yarn start - name: Upload run: yarn upload - name: Commit Changes + working-directory: ./dist run: | git config --local user.email "bot@tcgdex.net" git config --local user.name "TCGdex [bot]" - cd dist && git commit -m "Updated Database" -a && cd ../ + git commit -m "Updated Database" -a env: UPLOAD_REMOTE: ${{ secrets.UPLOAD_REMOTE }} UPLOAD_DIST: ${{ secrets.UPLOAD_DIST }} From 8d250743ee1378f5222e8829ca657554851806bf Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 15:54:21 +0200 Subject: [PATCH 09/12] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 9baf500..eedbee0 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -29,7 +29,7 @@ jobs: - name: Compile Database working-directory: ./db - run: git pull && yarn && yarn compile + run: git pull && yarn && cat package.json && yarn compile - name: Build working-directory: ./ From ed46262d44a463227cfecd125a73541afdc49b85 Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 18:23:06 +0200 Subject: [PATCH 10/12] Setup Github Actions (#4) --- .github/workflows/node.js.yml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index eedbee0..3062b51 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -5,7 +5,7 @@ name: Compile & Push on: push: - branches: [ master ] + branches: [ master, Aviortheking-patch-1 ] workflow_dispatch: repository_dispatch: types: @@ -17,6 +17,9 @@ jobs: steps: - uses: actions/checkout@v2 + with: + submodules: true + persist-credentials: false - name: Setup NodeJS uses: actions/setup-node@v2 @@ -24,33 +27,35 @@ jobs: node-version: '14.x' - name: Pull Distribution - working-directory: ./db + working-directory: ./dist run: git pull - name: Compile Database working-directory: ./db - run: git pull && yarn && cat package.json && yarn compile + run: git pull && yarn && yarn compile - name: Build working-directory: ./ run: yarn && yarn start && TCGDEX_COMPILER_LANG=fr yarn start - - - name: Upload - run: yarn upload - + - name: Commit Changes working-directory: ./dist run: | git config --local user.email "bot@tcgdex.net" git config --local user.name "TCGdex [bot]" git commit -m "Updated Database" -a + + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.PUSH_TOKEN }} + directory: ./dist + repository: tcgdex/distribution + + - name: Upload + run: yarn upload env: UPLOAD_REMOTE: ${{ secrets.UPLOAD_REMOTE }} UPLOAD_DIST: ${{ secrets.UPLOAD_DIST }} UPLOAD_USERNAME: ${{ secrets.UPLOAD_USERNAME }} UPLOAD_PASSWORD: ${{ secrets.UPLOAD_PASSWORD }} - - name: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.UPLOAD_TOKEN }} - directory: './dist' From ad310dee62d225d895c3741fa1b3e25884de8404 Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 18:34:42 +0200 Subject: [PATCH 11/12] Fix Pull (#5) --- .github/workflows/node.js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 3062b51..4d83dfa 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -28,11 +28,11 @@ jobs: - name: Pull Distribution working-directory: ./dist - run: git pull + run: git pull --rebase - name: Compile Database working-directory: ./db - run: git pull && yarn && yarn compile + run: git pull --rebase && yarn && yarn compile - name: Build working-directory: ./ From 5e79ae60584ad5ffe4dd9b3db81c5e40356c1ff2 Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 20 Apr 2021 19:34:47 +0200 Subject: [PATCH 12/12] Fix Github Action Errors (#6) --- .github/workflows/node.js.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 4d83dfa..46f98cf 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -5,7 +5,9 @@ name: Compile & Push on: push: - branches: [ master, Aviortheking-patch-1 ] + branches: + - master + pull_request: workflow_dispatch: repository_dispatch: types: @@ -18,7 +20,19 @@ jobs: steps: - uses: actions/checkout@v2 with: - submodules: true + persist-credentials: false + + + - uses: actions/checkout@v2 + with: + repository: tcgdex/cards-database + path: ./db + persist-credentials: false + + - uses: actions/checkout@v2 + with: + repository: tcgdex/distribution + path: ./dist persist-credentials: false - name: Setup NodeJS @@ -26,13 +40,9 @@ jobs: with: node-version: '14.x' - - name: Pull Distribution - working-directory: ./dist - run: git pull --rebase - - name: Compile Database working-directory: ./db - run: git pull --rebase && yarn && yarn compile + run: yarn && yarn compile - name: Build working-directory: ./ @@ -43,7 +53,8 @@ jobs: run: | git config --local user.email "bot@tcgdex.net" git config --local user.name "TCGdex [bot]" - git commit -m "Updated Database" -a + git add . + git commit -m "Updated Database" - name: Push changes uses: ad-m/github-push-action@master