-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into DDFBRA-76-opsaetning-af-next-js-og-graph-…
…ql-modules-i-dpl-cms
- Loading branch information
Showing
26 changed files
with
10,659 additions
and
10,152 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,13 @@ | ||
on: | ||
pull_request: | ||
# We have two groups of jobs in this workflow that reacts on actions: | ||
# | ||
# 1. We update the status of a Github Deployment on: | ||
# - opened | ||
# - synchronize | ||
# - reopened | ||
# - closed | ||
# | ||
# 2. We forward all events to lagoon via InformLagoon | ||
types: [ opened, synchronize, reopened, closed, edited ] | ||
name: Lagoon integration | ||
|
||
env: | ||
LAGOON_HOST: "dplplat01.dpl.reload.dk" | ||
LAGOON_PROJECT: "dpl-cms" | ||
|
||
LAGOON_ENVIRONMENT: "pr-${{github.event.number}}" | ||
GH_TOKEN: ${{ secrets.GH_DEPLOYMENT_TOKEN }} | ||
OWNER: ${{ github.repository_owner }} | ||
REPO: ${{ github.event.repository.name }} | ||
jobs: | ||
BranchNameLength: | ||
name: Check branch length | ||
|
@@ -31,100 +23,48 @@ jobs: | |
/^.{1,100}$/ | ||
errorMessage: 'Branch name too long. This cannot be deployed to Lagoon.' | ||
|
||
CheckEnvironment: | ||
name: Check environment | ||
# Creating the deployment that Lagoon will look for, and add status to. | ||
CreateDeployment: | ||
name: Creating deployment | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'synchronize' }} | ||
needs: [BranchNameLength] | ||
permissions: | ||
# Give the default GITHUB_TOKEN permission to create and update deployments | ||
deployments: write | ||
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }} | ||
steps: | ||
- name: Generate environment data | ||
id: environment | ||
run: | | ||
echo ::set-output name=id::pr-${{github.event.number}} | ||
echo ::set-output name=url::'https://varnish.pr-${{github.event.number}}.${{ env.LAGOON_PROJECT }}.${{ env.LAGOON_HOST }}/' | ||
echo ::set-output name=logs::'https://ui.lagoon.${{ env.LAGOON_HOST }}/projects/${{ env.LAGOON_PROJECT }}/${{ env.LAGOON_PROJECT }}-pr-${{github.event.number}}/deployments' | ||
- name: Start deployment | ||
uses: bobheadxi/[email protected] | ||
id: deployment | ||
with: | ||
step: start | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
env: ${{ steps.environment.outputs.id }} | ||
ref: ${{ github.head_ref }} | ||
logs: ${{ steps.environment.outputs.logs }} | ||
debug: ${{ runner.debug && 'true' || 'false' }} | ||
- name: Generate wait-on config | ||
# Retrieval of Let's Encrypt certificate sometimes fail in Lagoon. | ||
# In this case a self-signed certificate will be used. Allow this. | ||
run: | | ||
echo "{\"strictSSL\": false}" > $RUNNER_TEMP/wait-on.config.json | ||
- name: Wait for environment to become available | ||
uses: iFaxity/[email protected] | ||
with: | ||
resource: ${{ steps.environment.outputs.url }} | ||
# Time in ms. Wait for 20 mins for deployment to complete. We have | ||
# seen deployments taking up to 17 mins. | ||
timeout: 1200000 | ||
# Poll every 10 seconds. For whatever reason Lagoon environments may | ||
# return 200 during the deployment process even though the deployment | ||
# is not complete. Reduce polling interval to the risk of this | ||
# happening. | ||
interval: 10000 | ||
config: ${{ runner.temp }}/wait-on.config.json | ||
- name: Finish deployment | ||
if: always() | ||
uses: bobheadxi/[email protected] | ||
with: | ||
step: finish | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
status: ${{ job.status }} | ||
deployment_id: ${{ steps.deployment.outputs.deployment_id }} | ||
env: ${{ steps.deployment.outputs.env }} | ||
env_url: ${{ steps.environment.outputs.url }} | ||
logs: ${{ steps.environment.outputs.logs }} | ||
debug: ${{ runner.debug && 'true' || 'false' }} | ||
- run: | | ||
LAGOON_DEPLOYS_LOG_URL=$(echo "https://ui.lagoon.dplplat01.dpl.reload.dk/projects/dpl-cms/dpl-cms-${{ env.LAGOON_ENVIRONMENT }}/deployments") | ||
DEPLOYMENT_ID=$(echo '{ | ||
"ref": "${{ github.head_ref || github.ref_name }}", | ||
"environment": "${{ env.LAGOON_ENVIRONMENT }}", | ||
"auto_merge": false, | ||
"required_contexts": [] | ||
}' | gh api --method POST "/repos/${{ env.OWNER }}/${{ env.REPO }}/deployments" --input - --jq '.id') | ||
gh api --method POST "/repos/${{ env.OWNER }}/${{ env.REPO }}/deployments/$DEPLOYMENT_ID/statuses" \ | ||
-f "state=in_progress" -f "log_url=$LAGOON_DEPLOYS_LOG_URL" | ||
echo "deployment_id=$DEPLOYMENT_ID" >> $GITHUB_OUTPUT | ||
# When we close the pull request, we want to set the environment as inactive. | ||
CloseEnvironment: | ||
name: Close environment | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.action == 'closed' }} | ||
permissions: | ||
# Give the default GITHUB_TOKEN permission to close deployments. | ||
deployments: write | ||
steps: | ||
- name: Generate environment data | ||
id: environment | ||
run: | | ||
echo ::set-output name=id::pr-${{github.event.number}} | ||
- name: Close environment | ||
uses: bobheadxi/[email protected] | ||
with: | ||
step: deactivate-env | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
env: ${{ steps.environment.outputs.id }} | ||
debug: ${{ runner.debug && 'true' || 'false' }} | ||
- run: gh api --method DELETE "/repos/${{ env.OWNER }}/${{ env.REPO }}/environments/${{ env.LAGOON_ENVIRONMENT }}" | ||
|
||
# We only permit the integration with Lagoon to run if the user is | ||
# authorized. This saves on resources and ensures we only spin up sites for | ||
# legitimate contributions. | ||
# The integration is controlled by creating synthetic events related to select | ||
# pull-request events, and send them to Lagoon. | ||
# | ||
# The job expects the following secrets: | ||
# LAGOON_WEBHOOK_URL: The url events are to be delivered to | ||
# LAGOON_WEBHOOK_SECRET: Shared lagoon webhook secret | ||
# | ||
InformLagoon: | ||
name: Send synthetic event to Lagoon | ||
runs-on: ubuntu-latest | ||
needs: [BranchNameLength] | ||
steps: | ||
- name: Send pull request event | ||
uses: distributhor/workflow-webhook@v3 | ||
env: | ||
webhook_url: ${{ secrets.LAGOON_WEBHOOK_URL }} | ||
webhook_secret: ${{ secrets.LAGOON_WEBHOOK_SECRET }} | ||
webhook_type: 'json-extended' | ||
- name: Send pull request event | ||
uses: distributhor/workflow-webhook@v3 | ||
env: | ||
webhook_url: ${{ secrets.LAGOON_WEBHOOK_URL }} | ||
webhook_secret: ${{ secrets.LAGOON_WEBHOOK_SECRET }} | ||
webhook_type: 'json-extended' |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
config/sync/core.entity_view_display.media.image.redia_feed_large.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
uuid: 014a5ed5-1c85-432f-a1b8-3814869178fd | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- core.entity_view_mode.media.redia_feed_large | ||
- field.field.media.image.field_byline | ||
- field.field.media.image.field_media_image | ||
- image.style.redia_feed_large | ||
- media.type.image | ||
module: | ||
- image | ||
id: media.image.redia_feed_large | ||
targetEntityType: media | ||
bundle: image | ||
mode: redia_feed_large | ||
content: | ||
field_media_image: | ||
type: image | ||
label: hidden | ||
settings: | ||
image_link: '' | ||
image_style: redia_feed_large | ||
image_loading: | ||
attribute: lazy | ||
third_party_settings: { } | ||
weight: 0 | ||
region: content | ||
hidden: | ||
created: true | ||
field_byline: true | ||
langcode: true | ||
name: true | ||
search_api_excerpt: true | ||
thumbnail: true | ||
uid: true |
Oops, something went wrong.