forked from chloez21/Flask-injection-detection
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.43 KB
/
docker-image.yml
File metadata and controls
46 lines (38 loc) · 1.43 KB
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
name: Docker Image CI
on:
push:
branches: [ "main" ]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/v2.26.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Images
env:
ALLOW_TRAINING: ${{ secrets.ALLOW_TRAINING }}
MODEL_URL: ${{ secrets.MODEL_URL }}
VECTORIZER_URL: ${{ secrets.VECTORIZER_URL }}
SECRET_TRAIN_PASSKEY: ${{ secrets.SECRET_TRAIN_PASSKEY }}
run: |
docker-compose -f docker-compose.yaml config > docker-stack.yml
docker buildx create --use
docker buildx build --push --platform linux/amd64 \
--tag mwcurtis20/sql-detect:latest \
--tag mwcurtis20/sql-detect:${{ github.sha }} \
--file Dockerfile .
- name: Cleanup
run: docker-compose down