Skip to content

Commit b696901

Browse files
Initial commit
Setup new Digital Mary Django site
0 parents  commit b696901

File tree

206 files changed

+16468
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+16468
-0
lines changed

.dockerignore

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102+
#poetry.lock
103+
104+
# pdm
105+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106+
#pdm.lock
107+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108+
# in version control.
109+
# https://pdm.fming.dev/#use-with-ide
110+
.pdm.toml
111+
112+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113+
__pypackages__/
114+
115+
# Celery stuff
116+
celerybeat-schedule
117+
celerybeat.pid
118+
119+
# SageMath parsed files
120+
*.sage.py
121+
122+
# Environments
123+
.env
124+
.venv
125+
env/
126+
venv/
127+
ENV/
128+
env.bak/
129+
venv.bak/
130+
131+
# Spyder project settings
132+
.spyderproject
133+
.spyproject
134+
135+
# Rope project settings
136+
.ropeproject
137+
138+
# mkdocs documentation
139+
/site
140+
141+
# mypy
142+
.mypy_cache/
143+
.dmypy.json
144+
dmypy.json
145+
146+
# Pyre type checker
147+
.pyre/
148+
149+
# pytype static type analyzer
150+
.pytype/
151+
152+
# Cython debug symbols
153+
cython_debug/
154+
155+
# Ide
156+
.idea/
157+
.vscode/
158+
159+
# docker specific
160+
.data/
161+
162+
# project specific
163+
node_modules/
164+
/static/
165+
*.sql
166+
167+
# Docker image specific
168+
/.github/

.github/workflows/main.yaml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: Tagged Deploy
2+
3+
# based on:
4+
# - https://docs.github.com/en/actions/tutorials/publish-packages/publish-docker-images#publishing-images-to-docker-hub-and-github-packages
5+
# - https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
6+
7+
on:
8+
push:
9+
tags:
10+
- 'v*'
11+
12+
env:
13+
GITLAB_PIPELINE_TRIGGER_URL: https://git.lib.sfu.ca/api/v4/projects/539/trigger/pipeline
14+
15+
permissions:
16+
packages: write
17+
contents: read
18+
attestations: write
19+
id-token: write
20+
21+
jobs:
22+
build:
23+
runs-on: ${{ matrix.runner }}
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
include:
28+
# - platform: linux/386 # No Node container for platform
29+
# runner: ubuntu-latest
30+
- platform: linux/amd64
31+
runner: ubuntu-latest
32+
# - platform: linux/arm/v6 # No Node container for platform
33+
# runner: ubuntu-24.04-arm
34+
# - platform: linux/arm/v7 # psycopg[binary] install issue
35+
# runner: ubuntu-24.04-arm
36+
- platform: linux/arm64
37+
runner: ubuntu-24.04-arm
38+
- platform: linux/arm64/v8
39+
runner: ubuntu-24.04-arm
40+
steps:
41+
- name: Prepare
42+
run: |
43+
platform=${{ matrix.platform }}
44+
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
45+
46+
- name: Docker meta
47+
id: meta
48+
uses: docker/metadata-action@v5
49+
with:
50+
images: ghcr.io/${{ github.repository }}
51+
52+
- name: Set up QEMU
53+
uses: docker/setup-qemu-action@v3
54+
55+
- name: Set up Docker Buildx
56+
uses: docker/setup-buildx-action@v3
57+
58+
- name: Login to Docker Hub
59+
uses: docker/login-action@v3
60+
with:
61+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
62+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
63+
64+
- name: Log in to Github Container Registry
65+
uses: docker/login-action@v3
66+
with:
67+
registry: ghcr.io
68+
username: ${{ github.actor }}
69+
password: ${{ secrets.GITHUB_TOKEN }}
70+
71+
- name: Checkout source code
72+
uses: actions/checkout@v5
73+
74+
- name: Build and push by digest
75+
id: build
76+
uses: docker/build-push-action@v6
77+
with:
78+
context: .
79+
platforms: ${{ matrix.platform }}
80+
labels: ${{ steps.meta.outputs.labels }}
81+
tags: ghcr.io/${{ github.repository }}
82+
outputs: type=image,push-by-digest=true,name-canonical=true,push=true
83+
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ env.PLATFORM_PAIR }}
84+
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ env.PLATFORM_PAIR }},mode=max
85+
86+
- name: Export digest
87+
run: |
88+
mkdir -p ${{ runner.temp }}/digests
89+
digest="${{ steps.build.outputs.digest }}"
90+
touch "${{ runner.temp }}/digests/${digest#sha256:}"
91+
92+
- name: Upload digest
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: digests-${{ env.PLATFORM_PAIR }}
96+
path: ${{ runner.temp }}/digests/*
97+
if-no-files-found: error
98+
retention-days: 1
99+
100+
push:
101+
runs-on: ubuntu-latest
102+
if: startsWith(github.ref, 'refs/tags/')
103+
needs:
104+
- build
105+
steps:
106+
- name: Download digests
107+
uses: actions/download-artifact@v4
108+
with:
109+
path: ${{ runner.temp }}/digests
110+
pattern: digests-*
111+
merge-multiple: true
112+
113+
- name: Docker meta
114+
id: meta
115+
uses: docker/metadata-action@v5
116+
with:
117+
images: ghcr.io/${{ github.repository }}
118+
119+
- name: Set up Docker Buildx
120+
uses: docker/setup-buildx-action@v3
121+
122+
- name: Log in to Github Container Registry
123+
uses: docker/login-action@v3
124+
with:
125+
registry: ghcr.io
126+
username: ${{ github.actor }}
127+
password: ${{ secrets.GITHUB_TOKEN }}
128+
129+
- name: Create manifest list and push
130+
working-directory: ${{ runner.temp }}/digests
131+
run: |
132+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
133+
$(printf 'ghcr.io/${{ github.repository }}@sha256:%s ' *)
134+
135+
- name: Inspect image
136+
run: |
137+
docker buildx imagetools inspect ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.version }}
138+
139+
- name: Trigger Gitlab Deploy Job
140+
run: |
141+
curl -X POST \
142+
--fail \
143+
-F token=${{ secrets.GITLAB_CI_TOKEN }} \
144+
-F "ref=main" \
145+
-F "variables[APP_RELEASE_TAG]=${{github.ref_name}}" \
146+
${{ env.GITLAB_PIPELINE_TRIGGER_URL }}

0 commit comments

Comments
 (0)