8 Commits
Author SHA1 Message Date
pizza2d1 408f2242a7 fixed
Build and Push Docker Image / docker (push) Successful in 3m1s
2026-09-19 02:23:18 -06:00
pizza2d1 08a14f9c99 Fix requirements
Build and Push Docker Image / docker (push) Successful in 3m0s
2026-09-19 02:14:46 -06:00
pizza2d1 051a9e5c5f fix again
Build and Push Docker Image / docker (push) Successful in 3m4s
2026-09-19 02:05:42 -06:00
pizza2d1 975ce1ec95 fix
Build and Push Docker Image / docker (push) Canceled after 1m28s
2026-09-19 02:04:30 -06:00
pizza2d1 e59ab8324c Fixed gitea runner issue
Build and Push Docker Image / docker (push) Failing after 11s
2026-09-19 02:02:11 -06:00
pizza2d1 2248cfef50 fixed (hopefully)
Build and Push Docker Image / docker (push) Failing after 11s
2026-09-19 01:56:16 -06:00
pizza2d1 df972f1e83 testing
Build and Push Docker Image / docker (push) Failing after 6s
2026-09-19 01:53:08 -06:00
pizza2d1 aa91ee8d7a Added docker image files 2026-09-19 01:47:28 -06:00
6 changed files with 130 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
DOCKERHUB_USERNAME="${1}"
DOCKERHUB_PASSWORD="${2}"
GITEA_OWNER_REPO="${3}"
GITEA_API_KEY="${4}"
gitea_username=$(echo "${GITEA_OWNER_REPO}" | sed 's/\/.*//')
repo_name=$(echo "${GITEA_OWNER_REPO}" | sed 's/^.*\///')
NEW_DOCKERHUB_TOKEN=$(curl -s -X POST "https://hub.docker.com/v2/auth/token" \
-H "Content-Type: application/json" \
-d "{\"identifier\": \"${DOCKERHUB_USERNAME}\", \"secret\": \"${DOCKERHUB_PASSWORD}\"}" \
| jq -r .access_token)
curl -X 'PUT' \
"https://gitea.happylizard.me/api/v1/repos/${gitea_username}/${repo_name}/actions/secrets/DOCKERHUB_TOKEN" \
-H 'accept: application/json' \
-H "Authorization: token ${GITEA_API_KEY}" \
-H 'Content-Type: application/json' \
-d "{
\"data\": \"${NEW_DOCKERHUB_TOKEN}\",
\"description\": \"\"
}"
+53
View File
@@ -0,0 +1,53 @@
name: Build and Push Docker Image
on:
push:
branches:
- docker_upload
jobs:
docker:
runs-on: ubuntu-latest
steps:
- id: get-repo-name
name: Grab formatted repo name
run: |
repository_name=$(echo ${{ gitea.repository }} | sed 's/^.*\///')
dockerhub_repo_name=$(echo ${repository_name} | tr '[:upper:]' '[:lower:]')
echo "repository-name=$repository_name" >> "$GITEA_OUTPUT"
echo "dockerhub-repo-name=$dockerhub_repo_name" >> "$GITEA_OUTPUT"
- name: Print repo name (for testing)
run: |
echo "Repository name: ${{ steps.get-repo-name.outputs.repository-name }}"
echo "Dockerhub formatted repo name: ${{ steps.get-repo-name.outputs.dockerhub-repo-name }}"
- name: Checkout repository
uses: actions/checkout@v4
- run: |
./bin/update_dockerhub_api \
${{ secrets.DOCKERHUB_USERNAME }} \
${{ secrets.DOCKERHUB_PASSWORD }} \
${{ gitea.repository }} \
${{ secrets.API_KEY }}
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ steps.get-repo-name.outputs.dockerhub-repo-name }}:latest
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ steps.get-repo-name.outputs.dockerhub-repo-name }}:${{ gitea.sha }}
+19
View File
@@ -0,0 +1,19 @@
FROM python:3-alpine3.15
WORKDIR /app
# Install the application dependencies
# COPY . ./
COPY happy_ripper.py ./
COPY requirements.txt ./
COPY templates ./templates
RUN pip install --no-cache-dir -r requirements.txt
RUN apk add --no-cache ffmpeg
EXPOSE 5000
## Setup an app user so the container doesn't run as the root user
#RUN useradd app
#USER app
CMD ["python3", "./happy_ripper.py"]
+7
View File
@@ -0,0 +1,7 @@
read -p "Dockerhub username: " DOCKERHUB_USERNAME
read -p "Dockerhub PASSWORD: " DOCKERHUB_PASSWORD
curl -s -X POST "https://hub.docker.com/v2/auth/token" \
-H "Content-Type: application/json" \
-d "{\"identifier\": \"${DOCKERHUB_USERNAME}\", \"secret\": \"${DOCKERHUB_PASSWORD}\"}" \
| jq -r .access_token
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
DOCKERHUB_USERNAME="${1}"
DOCKERHUB_PASSWORD="${2}"
GITEA_OWNER_REPO="${3}"
GITEA_API_KEY="${4}"
gitea_username=$(echo "${GITEA_OWNER_REPO}" | sed 's/\/.*//')
repo_name=$(echo "${GITEA_OWNER_REPO}" | sed 's/^.*\///')
NEW_DOCKERHUB_TOKEN=$(curl -s -X POST "https://hub.docker.com/v2/auth/token" \
-H "Content-Type: application/json" \
-d "{\"identifier\": \"${DOCKERHUB_USERNAME}\", \"secret\": \"${DOCKERHUB_PASSWORD}\"}" \
| jq -r .access_token)
curl -X 'PUT' \
"https://gitea.happylizard.me/api/v1/repos/${gitea_username}/${repo_name}/actions/secrets/DOCKERHUB_TOKEN" \
-H 'accept: application/json' \
-H "Authorization: token ${GITEA_API_KEY}" \
-H 'Content-Type: application/json' \
-d "{
\"data\": \"${NEW_DOCKERHUB_TOKEN}\",
\"description\": \"\"
}"
+1
View File
@@ -1,3 +1,4 @@
Flask==3.1.3 Flask==3.1.3
mutagen==1.47.0 mutagen==1.47.0
yt_dlp==2026.8.19 yt_dlp==2026.8.19
ytmusicapi==1.12.3