Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment preview #7

Merged
merged 25 commits into from
Mar 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make it so image deploys happen on preview create
sunkickr committed Mar 17, 2023

Verified

This commit was signed with the committer’s verified signature.
snyk-bot Snyk bot
commit fe1dc30c7075a3feff6e6e6c83c301c1abcd9eb0
19 changes: 18 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
@@ -117,6 +117,9 @@ runs:

# don't skip deploy
echo "SKIP_DEPLOY=false" >> $GITHUB_OUTPUT

# image deploy only
echo "IMAGE_DEPLOY_ONLY=true" >> $GITHUB_OUTPUT
fi

# delete deployment preview and skip deploy if action is delete-deployment-preview
@@ -140,6 +143,9 @@ runs:

# skip deploy
echo "SKIP_DEPLOY=true" >> $GITHUB_OUTPUT

# not image deploy only
echo "IMAGE_DEPLOY_ONLY=false" >> $GITHUB_OUTPUT
fi

# # deploy to deployment preview if action is cdeploy-deployment-preview
@@ -164,6 +170,9 @@ runs:

# don't skip deploy
echo "SKIP_DEPLOY=false" >> $GITHUB_OUTPUT

# not image deploy only
echo "IMAGE_DEPLOY_ONLY=false" >> $GITHUB_OUTPUT
fi

# if action is deploy set final deployment id to deployment id
@@ -172,12 +181,20 @@ runs:

# don't skip deploy
echo "SKIP_DEPLOY=false" >> $GITHUB_OUTPUT

# not image deploy only
echo "IMAGE_DEPLOY_ONLY=false" >> $GITHUB_OUTPUT
fi

if [[ ${{steps.deployment-preview.outputs.SKIP_DEPLOY}} == nil ]]; then
echo ERROR: you specfied an improper action input. Action must be deploy, deploy-deployment-preview, create-deployment-preview, or delete-deployment-preview.
exit 1 # terminate and indicate error
fi
shell: bash
id: deployment-preview
- name: Determine if DAG Deploy is enabled
run: |
if [[ ${{steps.deployment-preview.outputs.SKIP_DEPLOY}} == false ]]; then
if [[ ${{steps.deployment-preview.outputs.SKIP_DEPLOY}} == false || ${{steps.deployment-preview.outputs.IMAGE_DEPLOY_ONLY}} == true ]]; then
echo "DAG_DEPLOY_ENABLED=$(astro deployment inspect ${{steps.deployment-preview.outputs.FINAL_DEPLOYMENT_ID}} --key configuration.dag_deploy_enabled)" >> $GITHUB_OUTPUT
else
echo "DAG_DEPLOY_ENABLED=false" >> $GITHUB_OUTPUT