diff --git a/.gitea/workflows/deploy-frontend.yaml b/.gitea/workflows/deploy-frontend.yaml index 40cd5b6d..7aac3cbf 100644 --- a/.gitea/workflows/deploy-frontend.yaml +++ b/.gitea/workflows/deploy-frontend.yaml @@ -28,6 +28,11 @@ jobs: - name: Set up environment run: | + # Create a .env file with the necessary environment variables from GitHub secrets + echo "REGISTRY_BOND_ID=${{ secrets.REGISTRY_BOND_ID }}" > .env + echo "DEPLOYER_LRN=lrn://vaasl-provider/deployers/webapp-deployer-api.apps.vaasl.io" >> .env + echo "AUTHORITY=laconic-deploy" >> .env + # Create a config file with necessary endpoints and placeholders for secrets cat > packages/deployer/config.yml </dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}') +NEW_APPLICATION_VERSION=$(yarn --silent laconic -c $CONFIG_FILE registry record list --type ApplicationRecord --all --name "deploy-frontend" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}') if [ -z "$NEW_APPLICATION_VERSION" ] || [ "1" == "$NEW_APPLICATION_VERSION" ]; then # Set application-record version if no previous records were found NEW_APPLICATION_VERSION=0.0.1 fi -# Generate application-deployment-request.yml -cat >./staging-records/application-deployment-request.yml <./staging-records/application-record.yml <./records/application-record.yml <./records/application-deployment-request.yml <