ff
This commit is contained in:
parent
0d126c1d45
commit
735d3de6f9
3 changed files with 28 additions and 82 deletions
|
@ -1,16 +1,39 @@
|
||||||
name: build
|
name: "lint, build and push"
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_run:
|
|
||||||
workflows: [linter]
|
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
|
|
||||||
# Variables: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
|
# Variables: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
gitleaks:
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Run Gitleaks
|
||||||
|
uses: docker://zricethezav/gitleaks:v8.18.4
|
||||||
|
with:
|
||||||
|
args: detect --no-git --verbose --source ${{ github.workspace }}
|
||||||
|
|
||||||
|
hadolint:
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Run hadolint
|
||||||
|
uses: docker://pipelinecomponents/hadolint:0.26.4
|
||||||
|
with:
|
||||||
|
args: hadolint Dockerfile
|
||||||
|
|
||||||
|
# shellcheck: # https://github.com/marketplace/actions/shellcheck
|
||||||
|
# steps:
|
||||||
|
# - name: Checkout code
|
||||||
|
# uses: actions/checkout@v4
|
||||||
|
# - name: Run ShellCheck
|
||||||
|
# uses: sudo-bot/action-shellcheck@latest
|
||||||
|
# with:
|
||||||
|
# cli-args: "shell.sh"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/actions/checkout@v4
|
- uses: https://github.com/actions/checkout@v4
|
||||||
|
@ -36,6 +59,3 @@ jobs:
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: "registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:latest,registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.extract_branch.outputs.REPO_BRANCH }}"
|
tags: "registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:latest,registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.extract_branch.outputs.REPO_BRANCH }}"
|
||||||
|
|
||||||
|
|
||||||
# depends on lint
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
name: linter
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
gitleaks:
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Run Gitleaks
|
|
||||||
uses: docker://zricethezav/gitleaks:v8.18.4
|
|
||||||
with:
|
|
||||||
args: detect --no-git --verbose --source ${{ github.workspace }}
|
|
||||||
|
|
||||||
hadolint:
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Run hadolint
|
|
||||||
uses: docker://pipelinecomponents/hadolint:0.26.4
|
|
||||||
with:
|
|
||||||
args: hadolint Dockerfile
|
|
||||||
|
|
||||||
# shellcheck: # https://github.com/marketplace/actions/shellcheck
|
|
||||||
# steps:
|
|
||||||
# - name: Checkout code
|
|
||||||
# uses: actions/checkout@v4
|
|
||||||
# - name: Run ShellCheck
|
|
||||||
# uses: sudo-bot/action-shellcheck@latest
|
|
||||||
# with:
|
|
||||||
# cli-args: "shell.sh"
|
|
|
@ -1,41 +0,0 @@
|
||||||
---
|
|
||||||
depends_on:
|
|
||||||
- lint
|
|
||||||
|
|
||||||
clone:
|
|
||||||
git:
|
|
||||||
image: "woodpeckerci/plugin-git:2.5.2"
|
|
||||||
settings:
|
|
||||||
depth: 9999 # wird benötigt um die Commits zählen zu können
|
|
||||||
lfs: false
|
|
||||||
partial: false
|
|
||||||
|
|
||||||
steps:
|
|
||||||
build_and_push: # damit dieser Step laufen kann muss das Repo in der Woodpecker-GUI "privilegiert" sein
|
|
||||||
image: "docker:27.2.0"
|
|
||||||
volumes:
|
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
commands:
|
|
||||||
# https://unix.stackexchange.com/questions/748633/error-multiple-platforms-feature-is-currently-not-supported-for-docker-driver
|
|
||||||
- docker buildx create --use --platform=linux/amd64 --name multi-platform-builder
|
|
||||||
- docker buildx inspect --bootstrap
|
|
||||||
- |
|
|
||||||
docker buildx build \
|
|
||||||
--no-cache \
|
|
||||||
--platform=linux/amd64 \
|
|
||||||
--push \
|
|
||||||
--tag registry.mgrote.net/${CI_REPO_NAME}:${CI_COMMIT_BRANCH} \
|
|
||||||
--tag registry.mgrote.net/${CI_REPO_NAME}:latest \
|
|
||||||
--label org.opencontainers.image.url=$CI_REPO_URL \
|
|
||||||
--label org.opencontainers.image.source=$CI_REPO_URL \
|
|
||||||
--label org.opencontainers.image.revision=$CI_COMMIT_SHA \
|
|
||||||
--label org.opencontainers.image.created=$DATE \
|
|
||||||
--file Dockerfile .
|
|
||||||
when:
|
|
||||||
- event: [push, pull_request, cron, manual]
|
|
||||||
evaluate: 'CI_COMMIT_AUTHOR_EMAIL != "renovate@mgrote.net"'
|
|
||||||
...
|
|
||||||
|
|
||||||
# händisch:
|
|
||||||
# docker build . -t registry.mgrote.net/allzweckcontainer:latest
|
|
||||||
# docker push registry.mgrote.net/allzweckcontainer:latest
|
|
Loading…
Reference in a new issue