diff --git a/.github/workflows/deploy-backend.yml b/.github/workflows/deploy-backend.yml index e9deb30..7c7ace6 100644 --- a/.github/workflows/deploy-backend.yml +++ b/.github/workflows/deploy-backend.yml @@ -2,6 +2,8 @@ name: Back4app deploy on: push: + branches: + - dev tags: - 'v**' - '!v**-alpha' @@ -25,12 +27,26 @@ jobs: - name: Auth with your back4app account run: echo ${{ secrets.BACK4APP_ACCOUNT_KEY }} | b4a configure accountkey - - name: Update applicationId in parse.local + - name: Install jq + run: sudo apt-get update && sudo apt-get install -y jq + + - name: Update applicationId in .parse.local run: | - # Read applicationId of github secret + cd backend + + # Verificar se o arquivo .parse.local existe + if [ ! -f .parse.local ]; then + echo "Error: .parse.local file not found" + exit 1 + fi + + # Debug: list files in backend dir + ls -al + + # read applicationId from .parse.local applicationId=${{ secrets.APPLICATION_ID }} - # Update the file parse.local with new applicationId + # update applicationId in .parse.local jq --arg applicationId "$applicationId" '.applications.visualizaai.applicationId = $applicationId' .parse.local > .parse.local.tmp && mv .parse.local.tmp .parse.local - name: Deploy your app