From 6da9ede5f052170ca2d225b353fe9c62843960d2 Mon Sep 17 00:00:00 2001 From: Adam Hlavacek Date: Sat, 27 Jul 2024 14:38:51 +0200 Subject: [PATCH] feat: automatic company manifest update --- .github/workflows/deploy-manifest-to-web.yaml | 36 +++++++++++++++++++ .github/workflows/generate-manifest.yaml | 1 + 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/deploy-manifest-to-web.yaml diff --git a/.github/workflows/deploy-manifest-to-web.yaml b/.github/workflows/deploy-manifest-to-web.yaml new file mode 100644 index 0000000..0176143 --- /dev/null +++ b/.github/workflows/deploy-manifest-to-web.yaml @@ -0,0 +1,36 @@ +name: generate-manifest +on: + push: + branches: + - 'master' + - 'main' + - 'prod' + paths: + - 'manifest.json' + + +jobs: + deploy-qrgamestudio-com: + runs-on: ubuntu-latest + env: + DEPLOY_SSH_KEY: ${{ secrets.WEB_QRGAMES_COM_DEPLOY_SSH_KEY }} + steps: + - run: mkdir src + - uses: actions/checkout@v2 + with: + fetch-depth: 100 + path: 'src' + - name: run deploy + shell: bash + run: | + eval `ssh-agent -s` + echo "$DEPLOY_SSH_KEY" | tr -d '\r' | ssh-add - && + git clone git@github.com:QRGameStudio/web-qrgamestudio-com.git && + cp "src/manifest.json" "web-qrgamestudio-com/src/lib/manifest.json" + git config --global user.email "git@qrgamestudio.com" && + git config --global user.name "QR Bot" && + cd web-qrgamestudio-com/src/lib/ && + git diff --exit-code || { echo "Nothing to do"; exit 0 } && + git add manifest.json && + git commit -m "chore: automatic manifest update" && + git push diff --git a/.github/workflows/generate-manifest.yaml b/.github/workflows/generate-manifest.yaml index 11a06dc..3678c49 100644 --- a/.github/workflows/generate-manifest.yaml +++ b/.github/workflows/generate-manifest.yaml @@ -26,6 +26,7 @@ jobs: python3 generate-manifest.py && git config --global user.email "git@qrgamestudio.com" && git config --global user.name "QR Bot" && + git diff --exit-code || { echo "Nothing to do"; exit 0 } && git add manifest.json README.md && git commit -m "chore: automatic manifest update" && git push