From 4cab4cadbf120949269b1c22dfe3be665a1e34bf Mon Sep 17 00:00:00 2001 From: "(Jip) Willem Wijnia" Date: Tue, 28 May 2024 08:27:18 +0200 Subject: [PATCH] Create a deploy workflow pt. 1 (#121) --- .github/workflows/deploy.yaml | 29 +++++++++++++++++------------ .github/workflows/generate.yaml | 26 +++++++++++--------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index dff32e4..d88d421 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,25 +1,23 @@ -name: build +name: deploy on: workflow_dispatch: jobs: - build: - name: build application + update: + name: update blueprint information + uses: FAForever/spooky-db/.github/workflows/generate.yaml@main + + deploy: + needs: [update] + name: deploy application runs-on: ubuntu-latest steps: - # https://github.com/actions/checkout/tree/v4/ - - name: Checkout spooky db code - uses: actions/checkout@v4 - with: - path: spookydb + # https://docs.github.com/en/actions/using-workflows/reusing-workflows # https://github.com/actions/checkout/tree/v4/ - name: Checkout spooky db code uses: actions/checkout@v4 - with: - path: gh-pages - ref: gh-pages # https://github.com/actions/setup-node/tree/main - name: Use Node.js 20.x @@ -28,6 +26,13 @@ jobs: cache: npm node-version: 20.x + # https://github.com/actions/checkout/tree/v4/ + - name: Checkout spooky db code + uses: actions/checkout@v4 + with: + path: gh-pages + ref: gh-pages + # - name: Installation # working-directory: spookydb # run: | @@ -44,7 +49,7 @@ jobs: - name: Deploying working-directory: gh-pages run: | - git log + git log - name: Uploading uses: actions/upload-artifact@v4 diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 10c0f88..70ae441 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -2,6 +2,13 @@ name: Generate blueprint data on: workflow_call: + inputs: + update: + description: "Update the repository" + required: false + type: "boolean" + default: true # it is a boolean here... + workflow_dispatch: inputs: update: @@ -70,18 +77,6 @@ jobs: lua -v pwsh ./index.ps1 -target ../app -inputUnits "temp/units" -inputLua "temp/lua" - - name: Minify index.json - uses: StefanEnsmann/Minify-Json-Action@1.1.0 - with: - input_file: app/data/index.json - output_file: app/data/index.minified.json - - - name: Minify index.fat.json - uses: StefanEnsmann/Minify-Json-Action@1.1.0 - with: - input_file: app/data/index.fat.json - output_file: app/data/index.fat.minified.json - - name: Add the generated file as an artifact uses: actions/upload-artifact@v4 with: @@ -108,7 +103,8 @@ jobs: git stage . git commit -m "Update generated data to game version ${{ fromJson(steps.gameVersionJSON.outputs.json).version}}" - git push origin HEAD:master + git log + # git push origin HEAD:master - git tag "${{ fromJson(steps.gameVersionJSON.outputs.json).version}}" - git tag push + # git tag "${{ fromJson(steps.gameVersionJSON.outputs.json).version}}" + # git tag push