Compare commits
39 commits
runner-din
...
developmen
Author | SHA1 | Date | |
---|---|---|---|
1d5fedb0e1 | |||
64ccd05681 | |||
092b1ae434 | |||
c33ca0f91e | |||
61e3aeecac | |||
0d181c1f13 | |||
a624f7c048 | |||
22b5bbc5ef | |||
39c04a0751 | |||
2fdcbfd19c | |||
1f0786a79a | |||
6ae9f6bce6 | |||
1a1b9d6a55 | |||
afe76ece74 | |||
17c2092b42 | |||
238ad6e67f | |||
4ae1d07c67 | |||
fb4eae7a0d | |||
1a8a18b1ed | |||
70b48d31d4 | |||
5f56a2e894 | |||
5b80e0503f | |||
11de6735e1 | |||
412abef199 | |||
23aef36197 | |||
9cca37f0cd | |||
c08b715e4a | |||
23384c5e75 | |||
880b5b4e13 | |||
435d69317f | |||
a06eff9cda | |||
dfc44a8f4f | |||
5f514fdd5f | |||
0da744db72 | |||
fb54e7d8de | |||
1e773c0025 | |||
9084cdc0c9 | |||
98b89ec337 | |||
bee6878f5c |
2 changed files with 49 additions and 30 deletions
78
.github/workflows/.github-ci.yaml
vendored
78
.github/workflows/.github-ci.yaml
vendored
|
@ -1,33 +1,51 @@
|
|||
name: ci-workflow
|
||||
|
||||
on: [push]
|
||||
name: ci
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
runs-on: docker
|
||||
|
||||
container:
|
||||
image: forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/pipeline-container/complete:v0.0.3
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
|
||||
- name: Clone Repository
|
||||
uses: https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/checkout@main
|
||||
|
||||
- name: Lint the Repository
|
||||
-
|
||||
name: Repository meta
|
||||
id: repository
|
||||
run: |
|
||||
golangci-lint run ./... --out-format=json --timeout 10m --issues-exit-code 1
|
||||
|
||||
- name: Build Credentials File
|
||||
run: |
|
||||
mkdir -p ~/.docker
|
||||
AUTHSTRING=$(echo -n "${{ secrets.REGISTRY_USERNAME }}:${{ secrets.REGISTRY_PASSWORD }}" | base64 -w 0)
|
||||
echo "{\"auths\":{\"https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live\":{\"auth\":\"${AUTHSTRING}\"}}}" > ~/.docker/config.json
|
||||
|
||||
- name: Build Docker Container
|
||||
run: |
|
||||
KO_DOCKER_REPO="forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/fibonacci_go" ko build --bare ./cmd
|
||||
|
||||
- name: Vulnerability Scanning
|
||||
run: |
|
||||
trivy image --scanners license,vuln,secret forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/fibonacci_go:latest
|
||||
trivy image --image-config-scanners secret,misconfig forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/devfw-cicd/fibonacci_go:latest
|
||||
registry=${{ github.server_url }}
|
||||
registry=${registry##http*://}
|
||||
echo "registry=${registry}" >> "$GITHUB_OUTPUT"
|
||||
echo "registry=${registry}"
|
||||
repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"
|
||||
echo "repository=${repository}" >> "$GITHUB_OUTPUT"
|
||||
echo "repository=${repository}"
|
||||
-
|
||||
name: Docker meta
|
||||
uses: docker/metadata-action@v5
|
||||
id: docker
|
||||
with:
|
||||
images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }}
|
||||
-
|
||||
name: Login to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ steps.repository.outputs.registry }}
|
||||
username: ${{ secrets.PACKAGES_USER }}
|
||||
password: ${{ secrets.PACKAGES_TOKEN }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
buildkitd-flags: '--allow-insecure-entitlement network.host'
|
||||
driver-opts: network=host
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
allow: network.host
|
||||
network: host
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: ${{ steps.docker.outputs.tags }}
|
||||
|
|
|
@ -5,6 +5,7 @@ COPY ./ ./
|
|||
|
||||
# RUN go mod download
|
||||
|
||||
RUN echo jojo
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o fibonacci-go cmd/main.go
|
||||
|
||||
# ToDo: use stretch as image for a completly empty container
|
||||
|
|
Loading…
Reference in a new issue