Skip to content

Commit

Permalink
Create a deploy workflow pt. 1 (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas authored May 28, 2024
1 parent 949db7e commit 4cab4ca
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 27 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: |
Expand All @@ -44,7 +49,7 @@ jobs:
- name: Deploying
working-directory: gh-pages
run: |
git log
git log
- name: Uploading
uses: actions/upload-artifact@v4
Expand Down
26 changes: 11 additions & 15 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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

0 comments on commit 4cab4ca

Please sign in to comment.