Skip to content

Commit 3cd0024

Browse files
authored
Merge branch 'master' into dev
2 parents 92a8264 + fe2735c commit 3cd0024

2 files changed

Lines changed: 50 additions & 12 deletions

File tree

.github/workflows/release-ci.yml

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,55 @@
1-
name: 'build and deploy test server'
1+
2+
name: 'Build and Deploy server'
23

34
on:
4-
push:
5-
branches: master
6-
workflow_dispatch:
5+
release:
6+
types: [ published ]
77

88
jobs:
9+
test:
10+
name: 'Test before deploy'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Set up Python 3.9
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.9
19+
20+
- name: cache poetry install
21+
uses: actions/cache@v2
22+
with:
23+
path: ~/.local
24+
key: poetry-1.2.2-0
25+
26+
- uses: snok/install-poetry@v1
27+
with:
28+
version: 1.2.2
29+
virtualenvs-create: true
30+
virtualenvs-in-project: true
31+
32+
- name: cache deps
33+
id: cache-deps
34+
uses: actions/cache@v2
35+
with:
36+
path: .venv
37+
key: pydeps-${{ hashFiles('**/poetry.lock') }}
38+
39+
- run: poetry install --no-root
40+
if: steps.cache-deps.outputs.cache-hit != 'true'
41+
42+
- run: poetry run pip install setuptools
43+
44+
- name: Run tests
45+
run: poetry run python manage.py test
46+
env:
47+
DEBUG: True
48+
949
build:
1050
name: 'Build & Publish'
1151
runs-on: ubuntu-latest
52+
needs: [ test ]
1253
steps:
1354
- name: "Checkout repository"
1455
uses: actions/checkout@v2
@@ -47,11 +88,7 @@ jobs:
4788
cache-to: type=gha,mode=max
4889
tags: ${{ steps.meta.outputs.tags }}
4990
labels: ${{ steps.meta.outputs.labels }}
50-
51-
run:
52-
runs-on: ubuntu-latest
53-
needs: [ build ]
54-
steps:
91+
5592
- name: run on server
5693
uses: garygrossgarten/github-action-ssh@release
5794
with:
@@ -78,6 +115,7 @@ jobs:
78115
echo "EMAIL_HOST=${{ secrets.EMAIL_HOST }}" >> .env &&
79116
echo "EMAIL_PORT=${{ secrets.EMAIL_PORT }}" >> .env &&
80117
81-
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env &&
82-
118+
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> .env
119+
83120
docker-compose -f docker-compose.prod-ci.yml -p prod up -d
121+

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ RUN poetry config virtualenvs.create false \
2323

2424
EXPOSE 8000
2525

26+
RUN mkdir /procollab/staticfiles
2627
RUN mkdir /procollab/static
2728

2829
COPY . /procollab/
2930

3031
CMD ["bash", "startup.sh"]
3132

32-
VOLUME ["/procollab/static/"]

0 commit comments

Comments
 (0)