-
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(container): build and push docker image to ghcr
- Loading branch information
Showing
9 changed files
with
148 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.github | ||
assets | ||
build | ||
.codecov.yaml | ||
.env | ||
.gitignore | ||
.golangci.yaml | ||
.goreleaser.yaml | ||
coverage.out | ||
Dockerfile | ||
Makefile |
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,16 @@ | ||
ITS_IMDB_COOKIEATMAIN=zAta|RHiA67JIrBDPaswIym3GyrTlEuQH-u9yrKP3BUNCHgVyE4oNtUzBYVKlhjjzBiM_Z-GSVnH9rKW3Hf7LdbejovoF6SI4ZmgJcTIUXoA4NVcH1Qahwm0KYCyz95o1gsgby-uQwdU6CoS6MFTnjMkLe1puNiv4uFkvo8mOQulJJeutzYedxiUd0ns9w1X_WeVXPTZWjwisPZMw3EOR6-q9xR4kCEWRW7CmWxU1AEDQbT8ns_AJJD34w1nIQUkuLgBQrvJI_pY | ||
ITS_IMDB_COOKIEUBIDMAIN=301-0710501-5367639 | ||
ITS_IMDB_EMAIL=user@domain.com | ||
ITS_IMDB_HEADLESS=true | ||
ITS_IMDB_LISTS=ls000000000,ls111111111 | ||
ITS_IMDB_PASSWORD=password123 | ||
ITS_IMDB_TRACE=false | ||
ITS_SYNC_HISTORY=false | ||
ITS_SYNC_MODE=dry-run | ||
ITS_SYNC_RATINGS=false | ||
ITS_SYNC_TIMEOUT=10m | ||
ITS_SYNC_WATCHLIST=false | ||
ITS_TRAKT_CLIENTID=828832482dea6fffa4453f849fe873de8be54791b9acc01f6923098d0a62972d | ||
ITS_TRAKT_CLIENTSECRET=bdf9bab88c17f3710a6394607e96cd3a21dee6e5ea0e0236e9ed06e425ed8b6f | ||
ITS_TRAKT_EMAIL=user@domain.com | ||
ITS_TRAKT_PASSWORD=password123 |
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: package | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
jobs: | ||
package: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Extract metadata | ||
uses: docker/metadata-action@v5 | ||
id: meta | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v6 | ||
id: push | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
- name: Generate artifact attestation | ||
uses: actions/attest-build-provenance@v2 | ||
with: | ||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |
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,33 @@ | ||
FROM golang:1.23.4-alpine AS build | ||
WORKDIR /app | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
COPY . . | ||
ENV CGO_ENABLED=0 | ||
RUN go build -o build/its main.go | ||
|
||
FROM ubuntu:24.04 | ||
WORKDIR /app | ||
COPY --from=build /app/build ./build | ||
COPY --from=build /app/config.yaml . | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV DEBCONF_NOWARNINGS=yes | ||
RUN apt-get update > /dev/null && \ | ||
apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
libasound2t64 \ | ||
libgbm1 \ | ||
libgtk-3-0 \ | ||
libnss3 \ | ||
libxss1 \ | ||
libxtst6 \ | ||
unzip \ | ||
wget > /dev/null && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
wget -q https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.204/linux64/chrome-linux64.zip && \ | ||
unzip -qq chrome-linux64.zip && \ | ||
rm chrome-linux64.zip | ||
ENV BROWSER_PATH=/app/chrome-linux64/chrome | ||
ENV PATH=$PATH:/app/build | ||
ENTRYPOINT ["its"] | ||
CMD ["sync"] |
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