-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
21 changed files
with
270 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: 'Docker Multi Login Action' | ||
description: 'Log in to dockerhub, quay, and github container registry' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- shell: bash | ||
run: | | ||
echo "🔑 Logging into dockerhub..." | ||
if docker login --username ${{ fromJSON(env.secrets).DOCKERHUB_USERNAME }} --password ${{ fromJSON(env.secrets).DOCKERHUB_PASSWORD }} > /dev/null 2>&1; then | ||
echo "🎉 Login Succeeded!" | ||
fi | ||
- shell: bash | ||
run: | | ||
echo "🔑 Logging into quay.io..." | ||
if docker login quay.io --username ${{ fromJSON(env.secrets).QUAY_USERNAME }} --password ${{ fromJSON(env.secrets).QUAY_PASSWORD }} > /dev/null 2>&1; then | ||
echo "🎉 Login Succeeded!" | ||
fi | ||
- shell: bash | ||
run: | | ||
echo "🔑 Logging into ghcr.io..." | ||
if docker login ghcr.io --username ${{ fromJSON(env.secrets).GHCR_USERNAME }} --password ${{ fromJSON(env.secrets).GHCR_PASSWORD }} > /dev/null 2>&1; then | ||
echo "🎉 Login Succeeded!" | ||
fi |
46 changes: 46 additions & 0 deletions
46
.github/actions/docker-target-image-list-action/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: 'Docker Target Image List Generator' | ||
description: 'A Github Action to generate a list of fully qualified target images for docker related steps' | ||
inputs: | ||
registries: | ||
description: "Comma separated list of docker registries" | ||
required: false | ||
default: "docker.io,quay.io,ghcr.io" | ||
images: | ||
description: "Comma separated list of images" | ||
required: true | ||
tags: | ||
description: "Comma separated list of image tags" | ||
required: false | ||
default: "edge" | ||
outputs: | ||
fully-qualified-target-images: | ||
description: "List of fully qualified docker target images" | ||
value: ${{ steps.gen-fqti.outputs.fully-qualified-target-images }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Generate fully qualified docker target images | ||
id: gen-fqti | ||
shell: bash | ||
run: | | ||
IFS=',' read -r -a registries <<< "${{ inputs.registries }}" | ||
IFS=',' read -r -a images <<< "${{ inputs.images }}" | ||
IFS=',' read -r -a tags <<< "${{ inputs.tags }}" | ||
FQTI="" | ||
echo "Generating fully qualified docker target images for:" | ||
echo "🐋 Registries: ${#registries[@]}" | ||
echo "📷 Images: ${#images[@]}" | ||
echo "🏷️ Tags: ${#tags[@]}" | ||
echo "🧮 Total: $((${#registries[@]}*${#images[@]}*${#tags[@]}))" | ||
for registry in "${registries[@]}"; do | ||
for image in "${images[@]}"; do | ||
for tag in "${tags[@]}"; do | ||
if [ -z "$FQTI" ]; then | ||
FQTI="${registry}/${image}:${tag}" | ||
else | ||
FQTI="$FQTI,${registry}/${image}:${tag}" | ||
fi | ||
done | ||
done | ||
done | ||
echo ::set-output name=fully-qualified-target-images::${FQTI} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: varken | ||
on: | ||
schedule: | ||
- cron: '0 10 * * *' | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
tags: | ||
- 'v*.*.*' | ||
paths: | ||
- '.github/workflows/docker.yaml' | ||
- 'varken/**' | ||
- 'Varken.py' | ||
- 'Dockerfile' | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
paths: | ||
- '.github/workflows/docker.yaml' | ||
- 'varken/**' | ||
- 'Varken.py' | ||
- 'Dockerfile' | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Use this tag instead of most recent' | ||
required: false | ||
ignore-existing-tag: | ||
description: 'Ignore existing tag if "true"' | ||
required: false | ||
env: | ||
IMAGES: boerderij/varken | ||
PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7" | ||
jobs: | ||
lint-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Lint | ||
run: pip install flake8 && flake8 --max-line-length 120 Varken.py varken/*.py | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: lint-and-test | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
VERSION=edge | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
VERSION=${GITHUB_REF#refs/tags/v} | ||
fi | ||
if [ "${{ github.event_name }}" = "schedule" ]; then | ||
VERSION=nightly | ||
fi | ||
if [[ ${GITHUB_REF##*/} == "develop" ]]; then | ||
VERSION=develop | ||
fi | ||
TAGS="${VERSION}" | ||
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then | ||
TAGS="$TAGS,latest" | ||
fi | ||
echo ::set-output name=version::${VERSION} | ||
echo ::set-output name=tags::${TAGS} | ||
echo ::set-output name=branch::${GITHUB_REF##*/} | ||
echo ::set-output name=build_date::$(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
echo ::set-output name=vcs_ref::${GITHUB_SHA::8} | ||
- uses: ./.github/actions/docker-target-image-list-action | ||
name: Generate Target Images | ||
id: gen-tags | ||
with: | ||
images: ${{ env.IMAGES }} | ||
tags: ${{ steps.prep.outputs.tags }} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: ${{ env.PLATFORMS }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
install: true | ||
version: latest | ||
driver-opts: image=moby/buildkit:master | ||
- name: Docker Multi Login | ||
uses: ./.github/actions/docker-multi-login-action | ||
env: | ||
secrets: ${{ toJSON(secrets) }} | ||
- name: Build and Push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: ${{ env.PLATFORMS }} | ||
pull: true | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.gen-tags.outputs.fully-qualified-target-images }} | ||
build-args: | | ||
VERSION=${{ steps.prep.outputs.version }} | ||
BRANCH=${{ steps.prep.outputs.branch }} | ||
BUILD_DATE=${{ steps.prep.outputs.build_date }} | ||
VCS_REF=${{ steps.prep.outputs.vcs_ref }} | ||
- name: Inspect | ||
if: ${{ github.event_name != 'pull_request' }} | ||
run: | | ||
IFS=',' read -r -a images <<< "${{ steps.gen-tags.outputs.fully-qualified-target-images }}" | ||
for image in "${images[@]}"; do | ||
docker buildx imagetools inspect ${image} | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: 'Invalid Template' | ||
|
||
on: | ||
issues: | ||
types: [labeled, unlabeled, reopened] | ||
|
||
jobs: | ||
support: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dessant/support-requests@v2 | ||
with: | ||
github-token: ${{ github.token }} | ||
support-label: 'invalid:template-incomplete' | ||
issue-comment: > | ||
:wave: @{issue-author}, please edit your issue and follow the template provided. | ||
close-issue: false | ||
lock-issue: false | ||
issue-lock-reason: 'resolved' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: 'Support Request' | ||
|
||
on: | ||
issues: | ||
types: [labeled, unlabeled, reopened] | ||
|
||
jobs: | ||
support: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dessant/support-requests@v2 | ||
with: | ||
github-token: ${{ github.token }} | ||
support-label: 'support' | ||
issue-comment: > | ||
:wave: @{issue-author}, we use the issue tracker exclusively | ||
for bug reports and feature requests. However, this issue appears | ||
to be a support request. Please use our support channels | ||
to get help with Varken! | ||
- [Discord](https://discord.gg/VjZ6qSM) | ||
- [Discord Quick Access](http://cyborg.decreator.dev/channels/518970285773422592/530424560504537105/) | ||
close-issue: true | ||
lock-issue: false | ||
issue-lock-reason: 'off-topic' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.