From c8f68bd1709e98b581ea3fd7ff8c904ff8b87050 Mon Sep 17 00:00:00 2001 From: Nemesis Date: Sun, 19 Feb 2023 20:27:47 +0100 Subject: [PATCH 1/4] ci: initial import script --- .github/workflows/import.js.yml | 62 +++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/import.js.yml diff --git a/.github/workflows/import.js.yml b/.github/workflows/import.js.yml new file mode 100644 index 0000000..22d4396 --- /dev/null +++ b/.github/workflows/import.js.yml @@ -0,0 +1,62 @@ +name: Auto import + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + emblems: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run import:emblems + + costumes: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run import:costumes + + weapons: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run import:weapon-stories -- 2.40.1 From 2446886103c9e5d6f3a667e7c5da30b52cf7bee6 Mon Sep 17 00:00:00 2001 From: Nemesis Date: Sun, 19 Feb 2023 20:30:43 +0100 Subject: [PATCH 2/4] ci: move to cron --- .github/workflows/import.js.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/import.js.yml b/.github/workflows/import.js.yml index 22d4396..db04627 100644 --- a/.github/workflows/import.js.yml +++ b/.github/workflows/import.js.yml @@ -1,10 +1,8 @@ name: Auto import on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + schedule: + - cron: "0 0 * * 0" jobs: emblems: -- 2.40.1 From 6cb44237f3002756b1eaca95d6b180bb7141efc1 Mon Sep 17 00:00:00 2001 From: Nemesis Date: Sun, 19 Feb 2023 20:32:04 +0100 Subject: [PATCH 3/4] ci: move import costumes below emblems --- .github/workflows/import.js.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.github/workflows/import.js.yml b/.github/workflows/import.js.yml index db04627..ce02402 100644 --- a/.github/workflows/import.js.yml +++ b/.github/workflows/import.js.yml @@ -5,7 +5,7 @@ on: - cron: "0 0 * * 0" jobs: - emblems: + costumes: runs-on: ubuntu-latest @@ -22,23 +22,6 @@ jobs: cache: 'npm' - run: npm ci - run: npm run import:emblems - - costumes: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [18.x] - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci - run: npm run import:costumes weapons: -- 2.40.1 From da49f95c3e40f3e259cd5721b94efcb1be076d92 Mon Sep 17 00:00:00 2001 From: Nemesis Date: Sun, 19 Feb 2023 20:36:50 +0100 Subject: [PATCH 4/4] ci: add secrets to workflow --- .github/workflows/import.js.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/import.js.yml b/.github/workflows/import.js.yml index ce02402..bf54eb2 100644 --- a/.github/workflows/import.js.yml +++ b/.github/workflows/import.js.yml @@ -4,6 +4,11 @@ on: schedule: - cron: "0 0 * * 0" +env: + STRAPI_BASE_API_URL: ${{ secrets.STRAPI_BASE_API_URL }} + STRAPI_GRAPHQL: ${{ secrets.STRAPI_GRAPHQL }} + STRAPI_API_TOKEN: ${{ secrets.STRAPI_API_TOKEN }} + jobs: costumes: -- 2.40.1