From 86eff6d033fbf836c72d962154d7607c54be7ed7 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Thu, 21 Nov 2024 12:40:12 +0000 Subject: [PATCH] forgejo: Fix ci --- {.gitea => .forgejo}/workflows/deploy.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename {.gitea => .forgejo}/workflows/deploy.yaml (78%) diff --git a/.gitea/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml similarity index 78% rename from .gitea/workflows/deploy.yaml rename to .forgejo/workflows/deploy.yaml index a86ce3e..9b64b49 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -5,7 +5,7 @@ on: jobs: deploy: - runs-on: alpine + runs-on: arch steps: - name: Check out repository code uses: actions/checkout@v3 @@ -32,10 +32,10 @@ jobs: CURR_VER="$(cat package.json | jq -r .name)_v$(cat package.json | jq -r .version)" CURR_NAME="$(cat package.json | jq -r .name) v$(cat package.json | jq -r .version)" - echo "Checking https://git.nfp.is/api/v1/repos/${{ gitea.repository }}/releases for name ${CURR_NAME}" + echo "Checking https://git.nfp.is/api/v1/repos/${{ github.repository }}/releases for name ${CURR_NAME}" - if curl -s -X GET -H "Authorization: token ${{ secrets.deploytoken }}" https://git.nfp.is/api/v1/repos/${{ gitea.repository }}/releases | grep -o "\"name\"\:\"${CURR_NAME}\"" > /dev/null; then - echo "Skipping ${{ gitea.job }} since $CURR_NAME already exists"; + if curl -s -X GET -H "Authorization: token ${{ secrets.deploytoken }}" https://git.nfp.is/api/v1/repos/${{ github.repository }}/releases | grep -o "\"name\"\:\"${CURR_NAME}\"" > /dev/null; then + echo "Skipping ${{ github.job }} since $CURR_NAME already exists"; cd .. continue; fi @@ -56,8 +56,8 @@ jobs: -X POST \ -H "Authorization: token ${{ secrets.deploytoken }}" \ -H "Content-Type: application/json" \ - https://git.nfp.is/api/v1/repos/${{ gitea.repository }}/releases \ - -d "{\"tag_name\":\"${CURR_VER}\",\"name\":\"${CURR_NAME}\",\"body\":\"Automatic release from Appveyor from ${{ gitea.sha }} :\n\n${{ gitea.event.head_commit.message }}\"}") + https://git.nfp.is/api/v1/repos/${{ github.repository }}/releases \ + -d "{\"tag_name\":\"${CURR_VER}\",\"name\":\"${CURR_NAME}\",\"body\":\"Automatic release from Appveyor from ${{ github.sha }} :\n\n${{ github.event.head_commit.message }}\"}") RELEASE_ID=$(echo $RELEASE_RESULT | jq -r .id) echo "Adding ${CURR_VER}_build-sc.7z to release ${RELEASE_ID}" @@ -66,14 +66,14 @@ jobs: -X POST \ -H "Authorization: token ${{ secrets.deploytoken }}" \ -F "attachment=@${CURR_VER}_build-sc.7z" \ - https://git.nfp.is/api/v1/repos/${{ gitea.repository }}/releases/$RELEASE_ID/assets + https://git.nfp.is/api/v1/repos/${{ github.repository }}/releases/$RELEASE_ID/assets MAN_PORT=$(cat package.json | jq -r .port) MAN_NAME=$(cat package.json | jq -r .name) echo "Deplying to production" - echo "curl -X POST http://192.168.93.51:$MAN_PORT/update/$MAN_NAME" - curl -X POST http://192.168.93.51:$MAN_PORT/update/$MAN_NAME + echo "curl -X POST http://192.168.93.52:$MAN_PORT/update/$MAN_NAME" + curl -X POST http://192.168.93.52:$MAN_PORT/update/$MAN_NAME cd .. done \ No newline at end of file