-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (50 loc) · 1.51 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Deploy to DockerHub
on:
push:
branches:
- "main"
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install pip and poetry
run: pip install --upgrade pip poetry
- uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('src/poetry.lock') }}
- name: Install Poetry dependencies
run: cd src && poetry install
- uses: actions/cache@v4
with:
path: src/frontend/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('src/frontend/package-lock.json') }}
- name: Install Node dependencies
run: cd src/frontend && npm install
- name: Build frontend
run: cd src/frontend && npm run build
- name: Run tests
run: cd src && poetry run pytest -v
docker:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: micahflee/blueleaks-explorer:latest