Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/reusable-cron-check-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ permissions:
contents: read
issues: write
pull-requests: read
packages: write

jobs:
dependency-check:
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Meta repository for [devops-infra](https://github.com/devops-infra) organization


# Badge swag
[
![GitHub repo](https://img.shields.io/badge/GitHub-devops--infra%2F.github-blueviolet.svg?style=plastic&logo=github)
Expand Down
3 changes: 3 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ version: '3'

silent: true

dotenv:
- .env

includes:
variables: ./Taskfile.variables.yml
cicd:
Expand Down
37 changes: 33 additions & 4 deletions templates/actions/taskfiles/Taskfile.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,39 @@ tasks:
docker:login:
desc: Login to hub.docker.com and ghcr.io
cmds:
- echo "Logging into Docker Hub as {{.DOCKER_USERNAME}}"
- echo "${DOCKER_TOKEN}" | docker login -u "{{.DOCKER_USERNAME}}" --password-stdin
- echo "Logging into GHCR as {{.GITHUB_USERNAME}}"
- echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "{{.GITHUB_USERNAME}}" --password-stdin
- |
set -eu
docker_username='{{.DOCKER_USERNAME}}'
github_username='{{.GITHUB_USERNAME}}'
has_dockerhub=false
has_ghcr=false

if [ -n "$docker_username" ] && [ -n "${DOCKER_TOKEN:-}" ]; then
has_dockerhub=true
fi

if [ -n "$github_username" ] && [ -n "${GITHUB_TOKEN:-}" ]; then
has_ghcr=true
fi

if [ "$has_dockerhub" = false ] && [ "$has_ghcr" = false ]; then
echo "❌ No registry credentials provided. Set DOCKER_USERNAME/DOCKER_TOKEN or GITHUB_USERNAME/GITHUB_TOKEN."
exit 1
fi

if [ "$has_dockerhub" = true ]; then
echo "Logging into Docker Hub as $docker_username"
printf '%s' "${DOCKER_TOKEN}" | docker login -u "$docker_username" --password-stdin
else
echo "⚠️ Skipping Docker Hub login (missing DOCKER_USERNAME/DOCKER_TOKEN)"
fi

if [ "$has_ghcr" = true ]; then
echo "Logging into GHCR as $github_username"
printf '%s' "${GITHUB_TOKEN}" | docker login ghcr.io -u "$github_username" --password-stdin
else
echo "⚠️ Skipping GHCR login (missing GITHUB_USERNAME/GITHUB_TOKEN)"
fi

docker:cmds:
desc: Show full docker build command
Expand Down
3 changes: 3 additions & 0 deletions templates/actions/taskfiles/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ version: '3'

silent: true

dotenv:
- .env

includes:
variables: ./Taskfile.variables.yml
cicd:
Expand Down
37 changes: 33 additions & 4 deletions templates/dockerized/taskfiles/Taskfile.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,39 @@ tasks:
docker:login:
desc: Login to hub.docker.com and ghcr.io
cmds:
- echo "Logging into Docker Hub as {{.DOCKER_USERNAME}}"
- echo "${DOCKER_TOKEN}" | docker login -u "{{.DOCKER_USERNAME}}" --password-stdin
- echo "Logging into GHCR as {{.GITHUB_USERNAME}}"
- echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "{{.GITHUB_USERNAME}}" --password-stdin
- |
set -eu
docker_username='{{.DOCKER_USERNAME}}'
github_username='{{.GITHUB_USERNAME}}'
has_dockerhub=false
has_ghcr=false

if [ -n "$docker_username" ] && [ -n "${DOCKER_TOKEN:-}" ]; then
has_dockerhub=true
fi

if [ -n "$github_username" ] && [ -n "${GITHUB_TOKEN:-}" ]; then
has_ghcr=true
fi

if [ "$has_dockerhub" = false ] && [ "$has_ghcr" = false ]; then
echo "❌ No registry credentials provided. Set DOCKER_USERNAME/DOCKER_TOKEN or GITHUB_USERNAME/GITHUB_TOKEN."
exit 1
fi

if [ "$has_dockerhub" = true ]; then
echo "Logging into Docker Hub as $docker_username"
printf '%s' "${DOCKER_TOKEN}" | docker login -u "$docker_username" --password-stdin
else
echo "⚠️ Skipping Docker Hub login (missing DOCKER_USERNAME/DOCKER_TOKEN)"
fi

if [ "$has_ghcr" = true ]; then
echo "Logging into GHCR as $github_username"
printf '%s' "${GITHUB_TOKEN}" | docker login ghcr.io -u "$github_username" --password-stdin
else
echo "⚠️ Skipping GHCR login (missing GITHUB_USERNAME/GITHUB_TOKEN)"
fi

docker:cmds:
desc: Show full docker build command
Expand Down
3 changes: 3 additions & 0 deletions templates/dockerized/taskfiles/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ version: '3'

silent: true

dotenv:
- .env

includes:
variables: ./Taskfile.variables.yml
scripts: ./Taskfile.scripts.yml
Expand Down
3 changes: 3 additions & 0 deletions templates/other/taskfiles/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ version: '3'

silent: true

dotenv:
- .env

includes:
variables: ./Taskfile.variables.yml
scripts: ./Taskfile.scripts.yml
Expand Down
3 changes: 3 additions & 0 deletions templates/static/taskfiles/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ version: '3'

silent: true

dotenv:
- .env

includes:
variables: ./Taskfile.variables.yml
scripts: ./Taskfile.scripts.yml
Expand Down
Loading