summaryrefslogtreecommitdiff
path: root/.github/workflows/dockle.yml
blob: ec7073c9fd1de5bfd7497b0d2b634ceb4ee2e72e (plain)
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
---
name: Dockle

on:
  push:
    branches:
      - master
      - develop
  pull_request:

jobs:
  dockle:
    runs-on: ubuntu-latest

    env:
      DOCKER_CONTENT_TRUST: 1
      DOCKLE_VERSION: 0.4.15

    steps:
      - uses: actions/checkout@v6.0.1

      - name: Download and install dockle v${{ env.DOCKLE_VERSION }}
        run: |
          set -eux
          curl -L -o dockle.deb "https://github.com/goodwithtech/dockle/releases/download/v${DOCKLE_VERSION}/dockle_${DOCKLE_VERSION}_Linux-64bit.deb"
          sudo dpkg -i dockle.deb

      - name: Build web image (docker build)
        run: |
          set -eux
          docker build -t "misskey-web:ci" .
          docker image ls

      - name: Mount tmpfs for Dockle tar
        env:
          TMPFS_SIZE: 8G
        run: |
          set -eux
          sudo mkdir -p /mnt/dockle-tmp
          sudo mount -t tmpfs -o size=${{ env.TMPFS_SIZE }} tmpfs /mnt/dockle-tmp
          free -h
          df -h

      - name: Save image tar into tmpfs
        run: |
          set -eux
          docker save misskey-web:ci -o /mnt/dockle-tmp/misskey-web.tar
          ls -lh /mnt/dockle-tmp/misskey-web.tar

      - name: Run Dockle Scan (tar input)
        run: |
          set -eux
          dockle --exit-code 1 --input /mnt/dockle-tmp/misskey-web.tar