ci: setup container build
This commit is contained in:
parent
2451719b0f
commit
75c3137262
15
.forgejo/workflows/build.yaml
Normal file
15
.forgejo/workflows/build.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
name: build
|
||||
run-name: ${{ gitea.actor }} is building subsyt
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: podman
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: podman login --username registry --password ${{ secrets.MEATBAG_REGISTRY_TOKEN }} registry.meatbag.se
|
||||
- run: podman build -t varl/subsyt:latest .
|
||||
- run: podman push varl/subsyt registry.meatbag.se/varl/subsyt
|
||||
46
Containerfile
Normal file
46
Containerfile
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
FROM golang:1.24-alpine as builder
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
COPY go.* .
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN go build -o /src/build/subsyt .
|
||||
|
||||
FROM archlinux:latest
|
||||
|
||||
RUN pacman -Syu --noconfirm \
|
||||
yt-dlp \
|
||||
ffmpeg \
|
||||
rtmpdump \
|
||||
atomicparsley \
|
||||
aria2 \
|
||||
python-mutagen \
|
||||
python-pycryptodome \
|
||||
python-pycryptodomex \
|
||||
python-websockets \
|
||||
python-brotli \
|
||||
python-brotlicffi \
|
||||
python-xattr \
|
||||
python-pyxattr
|
||||
|
||||
COPY <<-EOT /app/config.toml
|
||||
dry_run = false
|
||||
out_dir = "/data/vids"
|
||||
|
||||
[provider]
|
||||
[provider.youtube]
|
||||
cmd = "yt-dlp"
|
||||
url = "https://www.youtube.com"
|
||||
throttle = 1
|
||||
range = "1:5:1"
|
||||
after_date = "20250326"
|
||||
cookies = "/data/cookies.txt"
|
||||
opml_file = "/data/opml.xml"
|
||||
EOT
|
||||
|
||||
COPY --from=builder /src/build/subsyt /app/subsyt
|
||||
|
||||
WORKDIR /app
|
||||
ENTRYPOINT [ "/app/subsyt" ]
|
||||
|
|
@ -16,6 +16,7 @@ throttle = 1 # throttle yt request
|
|||
range = "1:5:1" # [START][:STOP][:STEP]
|
||||
after_date = "20250326" # not in use
|
||||
cookies = "./cookies.txt" # pass user cookies to yt
|
||||
opml_file = "./opml.xml" # the opml file to use
|
||||
```
|
||||
|
||||
`subs-opml.xml`:
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ type Provider struct {
|
|||
After_date string
|
||||
Cmd string
|
||||
Cookies string
|
||||
Opml_file string
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
|
|
|
|||
6
main.go
6
main.go
|
|
@ -14,13 +14,13 @@ func main() {
|
|||
panic(err)
|
||||
}
|
||||
|
||||
opml, err := opml.Load("./subs-opml.xml")
|
||||
provider := cfg.Provider["youtube"]
|
||||
|
||||
opml, err := opml.Load(provider.Opml_file)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
provider := cfg.Provider["youtube"]
|
||||
|
||||
for _, outlines := range opml.Body.Outline {
|
||||
log.Printf("Archiving videos from OPML: %s", outlines.Title)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue