-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (67 loc) · 1.94 KB
/
docker-build.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Docker Build
on:
push:
branches:
- release
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.13"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install black
# - name: Run formatting checks
# run: |
# black . --check --exclude "migrations/|manage.py|wsgi.py|asgi.py"
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
# deploy:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Checkout private config repo
# uses: actions/checkout@v4
# with:
# repository: gen-era/canvas-genera
# token: ${{ secrets.CANVAS }}
# path: canvas-genera
# - name: Docker Stack Deploy
# uses: cssnr/stack-deploy-action@v1
# with:
# name: canvas
# file: canvas-genera/docker-compose.yml
# user: canvas
# host: cnvcanvas.com
# ssh_key: ${{ secrets.CANVASFIXCLOUDDEPLOYKEY }}
# env_file: ./envfile