-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.67 KB
/
Copy pathauto-test-deploy.yml
File metadata and controls
61 lines (51 loc) · 1.67 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: CI - Security Scan + Build and Push to Docker Hub
on:
push:
branches: ["main"]
workflow_dispatch:
jobs:
shai-hulud-detector:
runs-on: ubuntu-latest
steps:
- name: Checkout current repo
uses: actions/checkout@v4
with:
path: app
clean: false
- name: Checkout Cobenian/shai-hulud-detect
uses: actions/checkout@v4
with:
repository: Cobenian/shai-hulud-detect
path: hulud
clean: false
- name: Security Scan with Shai-Hulud Detector
# Pipeline will automatically fail on exit codes 1 or 2
run: |
chmod +x ./hulud/shai-hulud-detector.sh
./hulud/shai-hulud-detector.sh ./app
build-and-push-admin:
needs: shai-hulud-detector
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Compute tags
run: |
echo "IMAGE_TAG_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Login to DockerHub (admin)
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_ADMIN_USERNAME }}
password: ${{ secrets.DOCKERHUB_ADMIN_TOKEN }}
- name: Build and push Docker image (admin)
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
docker.io/${{ secrets.DOCKERHUB_ADMIN_USERNAME }}/seb-documentation:latest
docker.io/${{ secrets.DOCKERHUB_ADMIN_USERNAME }}/seb-documentation:${{ env.IMAGE_TAG_SHA }}