Skip to content

Commit

Permalink
Release (#1659)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbiggs authored Jun 25, 2024
2 parents df2ae87 + 3a8e2a8 commit 2ef657a
Show file tree
Hide file tree
Showing 63 changed files with 2,736 additions and 1,138 deletions.
69 changes: 0 additions & 69 deletions .github/actions/docker-build/action.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/actions/get-version-tag/action.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/actions/install-aws/action.yml

This file was deleted.

16 changes: 8 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ updates:
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
- package-ecosystem: "npm"
versioning-strategy: "widen"
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-patch"]
# - package-ecosystem: "npm"
# versioning-strategy: "widen"
# directory: "/"
# schedule:
# interval: "weekly"
# ignore:
# - dependency-name: "*"
# update-types: ["version-update:semver-patch"]
2 changes: 1 addition & 1 deletion .github/workflows/branch-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- name: Get tag
id: version-tag
uses: ./.github/actions/get-version-tag
run: echo "VERSION=$(echo "${{ github.event.ref }}" | sed -e 's,/,-,g')" >> "$GITHUB_OUTPUT"
- name: Debug
run: echo "Clean up Docker image ${{ vars.DOCKER_IMAGE_NAME }}:${{ steps.version-tag.outputs.VERSION }}"
- name: Delete image
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/cd-feature.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/cd-main.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and deploy

on:
workflow_dispatch:
push:
release:
types:
- published

concurrency:
group: cd-${{ github.ref }}

jobs:
test:
name: Tests
uses: ./.github/workflows/_tests.yml
with:
python-version: ${{ vars.CI_PYTHON_VERSION }}
poetry-version: ${{ vars.CI_POETRY_VERSION }}

version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get tag
id: version-tag
uses: nationalarchives/ds-docker-actions/.github/actions/get-version-tag@main
outputs:
version: ${{ steps.version-tag.outputs.version-tag }}

build:
runs-on: ubuntu-latest
needs:
- test
- version
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Build Docker image
uses: nationalarchives/ds-docker-actions/.github/actions/docker-build@main
with:
version: ${{ needs.version.outputs.version }}
latest: ${{ github.ref == 'refs/heads/main' }}
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-image-name: ${{ vars.DOCKER_IMAGE_NAME }}
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml → .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: CI
name: Pull request

on:
pull_request:
types:
- opened
- synchronize

jobs:
ci:
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/release.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/remove-untagged.yml

This file was deleted.

12 changes: 8 additions & 4 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@
WAGTAILAPI_BASE_URL = os.getenv("WAGTAILAPI_BASE_URL", "")
WAGTAIL_HEADLESS_PREVIEW = {
"CLIENT_URLS": {
"default": "{SITE_ROOT_URL}",
"default": os.getenv("WAGTAILADMIN_HEADLESS_PREVIEW_URL", "{SITE_ROOT_URL}"),
},
"SERVE_BASE_URL": None, # can be used for HeadlessServeMixin
"REDIRECT_ON_PREVIEW": False, # set to True to redirect to the preview instead of using the Wagtail default mechanism
"ENFORCE_TRAILING_SLASH": True, # set to False in order to disable the trailing slash enforcement
"SERVE_BASE_URL": os.getenv("WAGTAILADMIN_HEADLESS_BASE_URL", None),
"REDIRECT_ON_PREVIEW": strtobool(
os.getenv("WAGTAILADMIN_HEADLESS_REDIRECT_ON_PREVIEW", "False")
),
"ENFORCE_TRAILING_SLASH": strtobool(
os.getenv("WAGTAILADMIN_HEADLESS_ENFORCE_TRAILING_SLASH", "True")
),
}

DEBUG = strtobool(os.getenv("DEBUG", "False"))
Expand Down
14 changes: 12 additions & 2 deletions config/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@
WAGTAILADMIN_BASE_URL = os.getenv("WAGTAILADMIN_BASE_URL", "http://localhost:8000")
WAGTAIL_HEADLESS_PREVIEW = {
"CLIENT_URLS": {
"default": "http://localhost:65535/preview",
"default": os.getenv(
"WAGTAILADMIN_HEADLESS_PREVIEW_URL", "http://localhost:65535/preview"
),
},
"SERVE_BASE_URL": "http://localhost:65535",
"SERVE_BASE_URL": os.getenv(
"WAGTAILADMIN_HEADLESS_BASE_URL", "http://localhost:65535"
),
"REDIRECT_ON_PREVIEW": strtobool(
os.getenv("WAGTAILADMIN_HEADLESS_REDIRECT_ON_PREVIEW", "False")
),
"ENFORCE_TRAILING_SLASH": strtobool(
os.getenv("WAGTAILADMIN_HEADLESS_ENFORCE_TRAILING_SLASH", "True")
),
}

# SECURITY WARNING: keep the secret key used in production secret!
Expand Down
6 changes: 1 addition & 5 deletions config/settings/platform.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from urllib.parse import urlparse

from platformshconfig import Config
from platformshconfig.config import (
BuildTimeVariableAccessException,
Expand All @@ -13,9 +11,7 @@
SECRET_KEY = config.projectEntropy

try:
ALLOWED_HOSTS = [
urlparse(url).netloc for url in config.get_upstream_routes().keys()
]
ALLOWED_HOSTS = ["*"]
except BuildTimeVariableAccessException:
# Routes aren't available during build-time. Unfortunately, this file needs
# to be accessed during collectstatic
Expand Down
Loading

0 comments on commit 2ef657a

Please sign in to comment.