Adjust workflow for branch

This commit is contained in:
hoellen 2021-12-08 21:17:07 +01:00
parent 90381a94d0
commit 1a61a40cad

View File

@ -3,7 +3,7 @@ name: build
on: on:
workflow_dispatch: workflow_dispatch:
push: push:
branches: [ master ] branches: [ version-22 ]
schedule: schedule:
# Build the image regularly (each Friday) # Build the image regularly (each Friday)
- cron: '23 04 * * 5' - cron: '23 04 * * 5'
@ -19,15 +19,14 @@ jobs:
- name: Build an image from Dockerfile - name: Build an image from Dockerfile
run: | run: |
docker build \ docker build \
-t ghcr.io/hoellen/nextcloud \ -t ghcr.io/${{ github.actor }}/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c6) \
-t ghcr.io/hoellen/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c6) \ -t ghcr.io/${{ github.actor }}/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c2) \
-t ghcr.io/hoellen/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c2) \
. .
- name: Run Trivy vulnerability scanner - name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master uses: aquasecurity/trivy-action@master
with: with:
image-ref: 'ghcr.io/hoellen/nextcloud' image-ref: 'ghcr.io/${{ github.actor }}/nextcloud'
format: 'template' format: 'template'
template: '@/contrib/sarif.tpl' template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif' output: 'trivy-results.sarif'
@ -46,6 +45,5 @@ jobs:
- name: Push image to GitHub - name: Push image to GitHub
run: | run: |
docker push ghcr.io/hoellen/nextcloud docker push ghcr.io/${{ github.actor }}/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c6)
docker push ghcr.io/hoellen/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c6) docker push ghcr.io/${{ github.actor }}/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c2)
docker push ghcr.io/hoellen/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c2)