Skip to content

Commit 41efa2c

Browse files
authored
Merge pull request #3 from Xpirix/fix_minor_issues
Fix minor issues
2 parents f81f808 + a87717e commit 41efa2c

Some content is hidden

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

42 files changed

+437
-3217
lines changed

.github/workflows/build-push-images-latest.yaml

Lines changed: 0 additions & 146 deletions
This file was deleted.
Lines changed: 15 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,39 @@
1-
name: release-build
1+
name: Build and Push Docker Image on release
22
on:
33
workflow_dispatch:
44
inputs:
55
tags:
66
description: 'Git tag to use'
7-
release:
8-
types:
9-
- released
107
push:
118
tags:
129
- '*.*.*.'
1310
- 'v*.*.*.'
1411
jobs:
1512
docker-builder-run-on-tag:
16-
if: ${{ github.event.inputs.tags }}
1713
runs-on: ubuntu-latest
1814
steps:
19-
- uses: actions/checkout@v2
20-
with:
21-
ref: ${{ github.event.inputs.tags }}
22-
23-
- name: Set up QEMU
24-
uses: docker/setup-qemu-action@v1
15+
- uses: actions/checkout@v4
16+
2517
- name: Set up Docker Buildx
26-
uses: docker/setup-buildx-action@v1
27-
- name: Login to DockerHub
28-
uses: docker/login-action@v1
29-
with:
30-
username: ${{ secrets.DOCKERHUB_USERNAME }}
31-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
32-
33-
- name: Build and push
34-
id: docker_build
35-
uses: docker/build-push-action@v2
36-
with:
37-
context: .
38-
file: deployment/docker/Dockerfile
39-
push: true
40-
target: prod
41-
tags: ${{ secrets.DOCKERHUB_REPO }}/projecta-uwsgi:${{ github.event.inputs.tags }}
42-
cache-from: type=gha,scope=prod
43-
cache-to: type=gha,scope=prod
44-
- name: Image digest
45-
run: echo ${{ steps.docker_build.outputs.digest }}
18+
uses: docker/setup-buildx-action@v3
4619

47-
docker-builder-run-on-tag-release:
48-
if: ${{ !github.event.inputs.tags }}
49-
runs-on: ubuntu-latest
50-
steps:
51-
- uses: actions/checkout@v2
52-
53-
- name: Set up QEMU
54-
uses: docker/setup-qemu-action@v1
55-
- name: Set up Docker Buildx
56-
uses: docker/setup-buildx-action@v1
5720
- name: Login to DockerHub
58-
uses: docker/login-action@v1
21+
uses: docker/login-action@v3
5922
with:
60-
username: ${{ secrets.DOCKERHUB_USERNAME }}
61-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
23+
username: ${{ secrets.DOCKER_USERNAME }}
24+
password: ${{ secrets.DOCKER_PASSWORD }}
6225

63-
- name: Docker meta
64-
id: docker_meta
65-
uses: docker/metadata-action@v3
66-
with:
67-
images: ${{ secrets.DOCKERHUB_REPO }}/projecta-uwsgi
68-
tags: |
69-
type=semver,pattern={{version}}
70-
type=ref,event=branch
71-
type=ref,event=pr
72-
73-
- name: Build and push
74-
id: docker_build
75-
uses: docker/build-push-action@v2
26+
- name: Build and push Docker image
27+
uses: docker/build-push-action@v6
7628
with:
7729
context: .
7830
file: deployment/docker/Dockerfile
7931
push: true
8032
target: prod
81-
tags: ${{ steps.docker_meta.outputs.tags }}
82-
labels: ${{ steps.docker_meta.outputs.labels }}
83-
cache-from: type=gha,scope=prod
84-
cache-to: type=gha,scope=prod
33+
tags: |
34+
qgis/qgis-changelog-uwsgi:${{ github.ref_name }}
35+
qgis/qgis-changelog-uwsgi:latest
36+
37+
- name: Log out from Docker Hub
38+
run: docker logout
8539

86-
- name: Image digest
87-
run: echo ${{ steps.docker_build.outputs.digest }}

.github/workflows/build-push-images-stable.yaml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/test.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: latest-build
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version:
16+
- '3.13'
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
23+
- name: Test installing development dependencies
24+
working-directory: deployment/docker
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r REQUIREMENTS-dev.txt
28+
29+
- name: Run Flake8 test
30+
run: flake8 .
31+
32+
test:
33+
runs-on: ubuntu-latest
34+
needs:
35+
- lint
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Run docker compose services
40+
working-directory: deployment
41+
run: |
42+
echo "Override docker compose for testing purposes"
43+
cp .env.example .env
44+
cp docker-compose.test.yml docker-compose.override.yml
45+
make build-devweb
46+
make devweb
47+
make wait-db
48+
make create-test-db
49+
50+
- name: Run tests
51+
working-directory: deployment
52+
run: |
53+
docker compose exec -T devweb bash -c '
54+
set -e # Exit immediately if any command fails
55+
python manage.py makemigrations &&
56+
python manage.py migrate &&
57+
python manage.py collectstatic --noinput --verbosity 0 &&
58+
python manage.py test
59+
'

deployment/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ DEFAULT_FROM_EMAIL=''
6363
# Stripe
6464
STRIPE_LIVE_SECRET_KEY='sk_live_key'
6565
STRIPE_LIVE_PUBLIC_KEY='pk_live_key'
66+
STRIPE_TEST_SECRET_KEY='sk_test_key'
67+
STRIPE_TEST_PUBLIC_KEY='pk_test_key'
6668
STRIPE_LIVE_MODE=True
6769
DJSTRIPE_WEBHOOK_SECRET='whsec_'
6870
# SENTRY

0 commit comments

Comments
 (0)