1
+ on :
2
+ workflow_call :
3
+
4
+ jobs :
5
+ build :
6
+ name : Build Docker image
7
+ runs-on : ubuntu-latest
8
+ env :
9
+ GENERATOR_IMAGE_NAME : decidim/decidim-generator
10
+ TEST_IMAGE_NAME : decidim/decidim-test
11
+ DEV_IMAGE_NAME : decidim/decidim-dev
12
+ APP_IMAGE_NAME : decidim/decidim
13
+ TAG : ${{ github.sha }}
14
+ steps :
15
+ - name : Fetch Decidim Tag
16
+ id : decidim-tag
17
+ uses : oprypin/find-latest-tag@v1
18
+ with :
19
+ repository : decidim/decidim
20
+ releases-only : true
21
+
22
+ - name : Set Ruby Version
23
+ id : ruby-version
24
+ env :
25
+ RUBY_VERSION_URL : https://raw.githubusercontent.com/decidim/decidim/${{ steps.decidim-tag.outputs.tag }}/.ruby-version
26
+ run : |
27
+ echo ::set-output name=version::$(curl -s $RUBY_VERSION_URL)
28
+ - name : Set Decidim Version
29
+ id : decidim-version
30
+ run : echo ::set-output name=version::$(echo ${{ steps.decidim-tag.outputs.tag }} | cut -c2-)
31
+
32
+ - name : Checkout Our Repo
33
+ uses : actions/checkout@v2
34
+
35
+ - name : Build decidim-generator Image
36
+ env :
37
+ RUBY_VERSION : ${{ steps.ruby-version.outputs.version }}
38
+ DECIDIM_VERSION : ${{ steps.decidim-version.outputs.version }}
39
+ run : |
40
+ docker build \
41
+ --build-arg ruby_version=$RUBY_VERSION \
42
+ --build-arg decidim_version=$DECIDIM_VERSION \
43
+ --file Dockerfile-generator \
44
+ -t $GENERATOR_IMAGE_NAME .
45
+ docker tag $GENERATOR_IMAGE_NAME $GENERATOR_IMAGE_NAME:$TAG
46
+ docker tag $GENERATOR_IMAGE_NAME ghcr.io/$GENERATOR_IMAGE_NAME:$TAG
47
+ docker tag $GENERATOR_IMAGE_NAME $GENERATOR_IMAGE_NAME:$DECIDIM_VERSION
48
+ docker tag $GENERATOR_IMAGE_NAME ghcr.io/$GENERATOR_IMAGE_NAME:$DECIDIM_VERSION
49
+ -
50
+ name : Scan for vulnerabilities
51
+ id : scan
52
+ uses : crazy-max/ghaction-container-scan@v3
53
+ with :
54
+ image : decidim/decidim-generator
55
+ dockerfile : ./Dockerfile-generator
0 commit comments