Merge pull request #242 from memser-spaceport/feat/husky-sidepanel #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Develop | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if user should trigger deployment | |
id: check_user | |
run: | | |
# Load the list of users from the secret | |
USERS_WITH_VERCEL_ACCESS="${{ secrets.VERCEL_USER_ACCESS_LIST }}" | |
# Convert the list to lowercase and split by comma | |
LOWERCASE_USERS=$(echo "$USERS_WITH_VERCEL_ACCESS" | tr '[:upper:]' '[:lower:]') | |
IFS=',' read -r -a USER_ARRAY <<< "$LOWERCASE_USERS" | |
# Convert the current GitHub actor to lowercase | |
LOWERCASE_ACTOR=$(echo "${GITHUB_ACTOR}" | tr '[:upper:]' '[:lower:]') | |
# Check if the current user is in the list | |
if [[ " ${USER_ARRAY[@]} " =~ " ${LOWERCASE_ACTOR} " ]]; then | |
echo "User ${LOWERCASE_ACTOR} has Vercel access. Skipping deployment." | |
echo "should_trigger=false" >> $GITHUB_ENV | |
else | |
echo "User ${LOWERCASE_ACTOR} does not have Vercel access. Proceeding with deployment." | |
echo "should_trigger=true" >> $GITHUB_ENV | |
fi | |
- name: Trigger Vercel deployment hook | |
if: env.should_trigger == 'true' | |
run: | | |
curl -X POST ${{ secrets.FRONTEND_DIRECTORY_PORTAL_DEV_DEPLOY_HOOK }} |