Skip to content

Commit fd83c3f

Browse files
committed
initial import
1 parent c8f0805 commit fd83c3f

15 files changed

+878
-1
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.md
2+
*.txt
3+
.github/
4+
.shared/.*
5+
.shared/*.md
6+
.shared/*.txt

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
indent_style = space
12+
indent_size = 3
13+
14+
[*.{bat,cmd}]
15+
end_of_line = crlf
16+
17+
[*.{yml,yaml}]
18+
indent_size = 2

.gitattributes

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# inspired by
2+
# - https://github.com/alexkaratarakis/gitattributes/blob/master/Java.gitattributes
3+
# - https://github.com/alexkaratarakis/gitattributes/blob/master/Common.gitattributes
4+
5+
# Handle line endings automatically for files detected as text
6+
# and leave all files detected as binary untouched.
7+
* text=auto
8+
9+
#
10+
# The above will handle all files with names NOT matching patterns defined below
11+
#
12+
13+
# Git files
14+
.gitattributes text eol=lf
15+
**/.gitattributes text eol=lf
16+
.gitignore text eol=lf
17+
**/.gitignore text eol=lf
18+
19+
20+
# Documents
21+
*.doc binary diff=astextplain
22+
*.docx binary diff=astextplain
23+
*.dot binary diff=astextplain
24+
*.pdf binary diff=astextplain
25+
*.ppt binary diff=astextplain
26+
*.pptx binary diff=astextplain
27+
*.rtf binary diff=astextplain
28+
*.vsd binary diff=astextplain
29+
*.vsdx binary diff=astextplain
30+
*.odt binary diff=odf
31+
*.ods binary diff=odf
32+
*.odp binary diff=odf
33+
*.adoc text
34+
*.csv text
35+
*.md text diff=markdown
36+
*.txt text
37+
38+
39+
# Config/Serialisation
40+
.editorconfig text
41+
**/.editorconfig text
42+
*.ini text
43+
*.properties text
44+
*.json text
45+
*.toml text
46+
*.xml text
47+
*.yaml text
48+
*.yml text
49+
50+
51+
# Scripts
52+
*.bat text eol=crlf
53+
*.cmd text eol=crlf
54+
*.ps1 text eol=crlf
55+
*.bash text eol=lf
56+
*.fish text eol=lf
57+
*.sh text eol=lf
58+
*.zsh text eol=lf
59+
*.lua text
60+
*.php text
61+
*.python text
62+
*.sql text
63+
**/Dockerfile text eol=lf
64+
65+
66+
# Archives
67+
*.7z binary
68+
*.gz binary
69+
*.tar binary
70+
*.tar.gz binary
71+
*.tgz binary
72+
*.xz binary
73+
*.zip binary
74+
75+
76+
# Native binaries
77+
*.dll binary
78+
*.dylib binary
79+
*.exe binary
80+
*.so binary
81+
82+
83+
# Images
84+
*.eps binary
85+
*.gif binary
86+
*.ico binary
87+
*.jpg binary
88+
*.jpeg binary
89+
*.png binary
90+
*.svg text
91+
*.svgz binary
92+
*.tif binary
93+
*.tiff binary
94+
95+
96+
# Fonts
97+
*.eot binary
98+
*.otf binary
99+
*.ttf binary
100+
*.woff binary
101+
102+
103+
# Java
104+
*.gradle text diff=java
105+
*.gradle.kts text diff=java
106+
*.java text diff=java
107+
*.class binary
108+
*.ear binary
109+
*.jceks binary
110+
*.jks binary
111+
*.jar binary
112+
*.pak binary
113+
*.war binary
114+
*.jsp text
115+
*.jspf text
116+
*.jspx text
117+
*.tld text
118+
*.tag text
119+
*.tagx text
120+
121+
122+
# Web
123+
*.css text diff=css
124+
*.htm text diff=html
125+
*.html text diff=html
126+
*.js text
127+
128+
129+
# https://git-scm.com/docs/gitattributes#_export_ignore
130+
.gitattributes export-ignore
131+
.gitignore export-ignore
132+
.gitkeep export-ignore

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
day: monday
9+
time: "09:00"
10+
commit-message:
11+
prefix: fix
12+
prefix-development: chore
13+
include: scope
14+
labels:
15+
- gha
16+
- dependencies

.github/stale.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Configuration for probot-stale - https://github.com/probot/stale
2+
3+
# Number of days of inactivity before an issue becomes stale
4+
daysUntilStale: 60
5+
6+
# Number of days of inactivity before a stale issue is closed
7+
daysUntilClose: 7
8+
9+
# Issues with these labels will never be considered stale
10+
exemptLabels:
11+
- pinned
12+
- security
13+
14+
# Label to use when marking an issue as stale
15+
staleLabel: wontfix
16+
17+
# Comment to post when marking an issue as stale. Set to `false` to disable
18+
markComment: >
19+
This issue has been automatically marked as stale because it has not had
20+
recent activity. It will be closed in 7 days if no further activity occurs.
21+
Thank you for your contributions.
22+
23+
# Comment to post when closing a stale issue. Set to `false` to disable
24+
closeComment: false

.github/workflows/build.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com)
2+
# SPDX-FileContributor: Sebastian Thomschke
3+
# SPDX-License-Identifier: Apache-2.0
4+
# SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/docker-gitea-act-runner
5+
#
6+
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
7+
name: Build
8+
9+
on:
10+
push:
11+
branches:
12+
- '**'
13+
tags-ignore:
14+
- '**'
15+
paths-ignore:
16+
- '**/*.md'
17+
- '.github/*.yml'
18+
schedule:
19+
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
20+
- cron: '0 17 * * 3'
21+
pull_request:
22+
workflow_dispatch:
23+
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
24+
25+
env:
26+
DOCKER_IMAGE_REPO: vegardit/gitea-act-runner
27+
DOCKER_IMAGE_TAG: latest
28+
TRIVY_CACHE_DIR: ~/.trivy/cache
29+
30+
defaults:
31+
run:
32+
shell: bash
33+
34+
jobs:
35+
build:
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- name: Git Checkout
40+
uses: actions/checkout@v3 #https://github.com/actions/checkout
41+
42+
- name: Cache trivy cache
43+
uses: actions/cache@v3
44+
if: env.ACT != 'true' # https://github.com/nektos/act#skipping-steps
45+
with:
46+
path: ${{ env.TRIVY_CACHE_DIR }}
47+
# https://github.com/actions/cache/issues/342#issuecomment-673371329
48+
key: ${{ runner.os }}-trivy-${{ github.run_id }}
49+
restore-keys: |
50+
${{ runner.os }}-trivy-
51+
52+
- name: Configure fast APT repository mirror
53+
uses: vegardit/fast-apt-mirror.sh@v1
54+
55+
- name: Install dos2unix
56+
run: sudo apt-get install --no-install-recommends -y dos2unix
57+
58+
- name: Build ${{ env.DOCKER_IMAGE_REPO }}:${{ env.DOCKER_IMAGE_TAG }}
59+
env:
60+
DOCKER_REGISTRY: docker.io
61+
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
62+
DOCKER_REGISTRY_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
63+
TRIVY_GITHUB_TOKEN: ${{ github.token }}
64+
run: |
65+
if [[ $GITHUB_REF_NAME == "main" && $ACT != "true" ]]; then
66+
export DOCKER_PUSH=1
67+
echo "$DOCKER_REGISTRY_TOKEN" | docker login -u="$DOCKER_REGISTRY_USERNAME" "$DOCKER_REGISTRY" --password-stdin
68+
fi
69+
bash build-image.sh
70+
71+
- name: Publish Docker image to GH registry
72+
if: ${{ github.ref_name == 'main' && !env.ACT }} # https://github.com/nektos/act#skipping-steps
73+
run: |
74+
set -eux
75+
76+
echo "${{ github.token }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
77+
78+
docker image tag $DOCKER_IMAGE_REPO ghcr.io/$DOCKER_IMAGE_REPO
79+
docker push ghcr.io/$DOCKER_IMAGE_REPO
80+
81+
- name: Delete untagged images
82+
uses: actions/github-script@v6
83+
if: ${{ github.ref_name == 'main' && !env.ACT }} # https://github.com/nektos/act#skipping-steps
84+
with:
85+
github-token: ${{ secrets.GHA_DELETE_PACKAGES }}
86+
script: |
87+
const imageName = /[^/]*$/.exec(process.env.DOCKER_IMAGE_REPO)[0]
88+
const basePath = `/orgs/${{ github.repository_owner }}/packages/container/${imageName}/versions`
89+
for (version of (await github.request(`GET ${basePath}`, { per_page: 100 })).data) {
90+
if (version.metadata.container.tags.length == 0) {
91+
console.log(`deleting ${version.name}...`)
92+
const delResponse = await github.request(`DELETE ${basePath}/${version.id}`)
93+
console.log(`status: ${delResponse.status}`)
94+
}
95+
}

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Local work folder that is not checked in
2+
_LOCAL/
3+
4+
.shared
5+
6+
# Eclipse
7+
.apt_generated/
8+
.checkstyle
9+
.classpath
10+
.factorypath
11+
.project
12+
.settings/
13+
bin/
14+
**/.*.md.html
15+
16+
# IntelliJ
17+
.idea
18+
*.iml
19+
*.ipr
20+
*.iws
21+
22+
# NetBeans
23+
nb-configuration.xml
24+
25+
# Visual Studio Code
26+
.vscode
27+
28+
# OSX
29+
.DS_Store
30+
31+
# Vim
32+
*.swo
33+
*.swp
34+
35+
# patch
36+
*.orig
37+
*.rej

0 commit comments

Comments
 (0)