Skip to content

chore: update dockerfile #94

chore: update dockerfile

chore: update dockerfile #94

name: Build and Test app
on:
push:
branches:
- "**"
- "!hml"
- "!prd"
- "!prd-host"
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
build-frontend:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: cd frontend && npm ci
- run: cd frontend && npm run check --if-present
- run: cd frontend && npm run test:static --if-present
- run: cd frontend && npm test --if-present
- run: cd frontend && npm run build --if-present
build-django:
runs-on: ubuntu-latest
needs: build-frontend
strategy:
max-parallel: 4
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
env:
TEST: 1
run: |
python manage.py test
test-image:
runs-on: ubuntu-latest
needs: build-django
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
steps:
- uses: actions/checkout@v2
- name: Run tests
run: |
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --build-arg AUTH_TOKEN=${{ secrets.AUTH_KEY }} --build-arg GTAG_ID=${{ secrets.GTAG_ID }} --file Dockerfile
fi