-
Notifications
You must be signed in to change notification settings - Fork 13
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
Optimizing GH actions, to use less minutes. (WIP) #1563
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
name: "Tests of deployment" | ||
|
||
on: | ||
deployment_status | ||
|
||
# @todo - this action does nothing useful right now, but it is to show that | ||
# the site URL is available as part of deployment_status. | ||
Comment on lines
+7
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I appreciate the comment but I suggest removing this file entirely. As I see it we should not run tests on the deployed environment as implied in the workflow name. We do this on the corresponding environment established in CI. |
||
jobs: | ||
tests: | ||
if: github.event.deployment_status.state == 'success' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "$URL" | ||
env: | ||
URL: ${{ github.event.deployment_status.target_url }} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,21 @@ project: dpl-cms-core | |
|
||
ssh: 20.238.147.183:22 | ||
api: https://api.lagoon.dplplat01.dpl.reload.dk/graphql | ||
environment_variables: | ||
git_sha: 'true' | ||
|
||
tasks: | ||
post-rollout: | ||
- run: | ||
name: Create new GH deployment | ||
command: | | ||
# @TODO Where can i place the token as a secret? | ||
achton marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider mentioning that we do not use |
||
export GH_DEPLOYMENT_TOKEN = 'XXX'; | ||
export GH_DEPLOYMENT_ID = $(curl -L \ | ||
-X POST \ | ||
-H "Authorization: Bearer $GH_DEPLOYMENT_TOKEN" \ | ||
https://api.github.com/repos/danskernesdigitalebibliotek/dpl-cms/deployments \ | ||
-d '{"ref":"$LAGOON_GIT_SHA","description":"Triggered by Lagoon"}'); | ||
- run: | ||
name: If drupal is not installed | ||
command: | | ||
|
@@ -92,7 +104,19 @@ tasks: | |
set -e | ||
drush en -y dpl_example_content | ||
service: cli | ||
# @TODO How do we run this, even if something has gone wrong? | ||
- run: | ||
name: Setting Deployment status | ||
command: | | ||
# @TODO How do we set this to 'failure', if something has gone wrong? | ||
DEPLOYMENT_STATUS="success"; | ||
Comment on lines
+107
to
+112
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. Perhaps this video helps? https://docs.lagoon.sh/resources/faq/#how-can-i-check-the-status-of-a-build You could also ask the Lagoon team on Discord. |
||
|
||
DRUPAL_URL=$(drush browse); | ||
export GH_DEPLOYMENT_ID = $(curl -L \ | ||
-X POST \ | ||
-H "Authorization: Bearer $GH_DEPLOYMENT_TOKEN" \ | ||
https://api.github.com/repos/danskernesdigitalebibliotek/dpl-cms/deployments/$GH_DEPLOYMENT_ID/statuses \ | ||
-d '{"environment":"$LAGOON_GIT_SHA","state":"$DEPLOYMENT_STATUS", "target_url":"$DRUPAL_URL"}'); | ||
environments: | ||
main: | ||
cronjobs: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we keep the Lagoon workflow around then I suggest moving this job back.