Skip to content

Commit

Permalink
make github build guest accounts for me
Browse files Browse the repository at this point in the history
  • Loading branch information
bepvte committed Feb 1, 2024
1 parent 7d846ed commit 723efb3
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 11 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ LICENSE
docker-compose.yml
Dockerfile
tests/
.github/
50 changes: 50 additions & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Docker

on:
workflow_dispatch:
push:
paths-ignore:
- "README.md"
branches:
- pre_guest_accounts

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{github.repository}}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push AMD64 Docker image
uses: docker/build-push-action@v5
with:
cache-to: type=registry,ref=${{ steps.meta.outputs.tags }}-cache,mode=max
cache-from: type=registry,ref=${{ steps.meta.outputs.tags }}-cache
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Prune
uses: vlaurin/[email protected]
with:
token: ${{ secrets.PAT_TOKEN }}
user: ${{ github.repository_owner }}
container: nitter
prune-untagged: true
keep-last: 2
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Tests

on:
push:
paths-ignore:
- "*.md"
branches-ignore:
- master
workflow_call:
on: []
# push:
# paths-ignore:
# - "*.md"
# branches-ignore:
# - master
# workflow_call:

jobs:
test:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ nitter
nitter.conf
guest_accounts.json*
dump.rdb
guest_accounts*
.env
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ COPY nitter.nimble .
RUN nimble install -y --depsOnly

COPY . .
RUN nimble build -d:danger -d:lto -d:strip \
RUN nimble build -x:off -d:strip \
&& nimble scss \
&& nimble md

Expand Down
13 changes: 10 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ version: "3"
services:

nitter:
image: ghcr.io/privacydevel/nitter:master
image: ghcr.io/bepvte/nitter:pre_guest_accounts
container_name: nitter
ports:
- "127.0.0.1:8080:8080" # Replace with "8080:8080" if you don't use a reverse proxy
- "127.0.0.1:8083:8080" # Replace with "8080:8080" if you don't use a reverse proxy
volumes:
- ./nitter.conf:/src/nitter.conf:Z,ro
# - ./guest_accounts.json:/src/guest_accounts.json:Z,ro
restart: unless-stopped
depends_on:
- nitter-redis
restart: unless-stopped
healthcheck:
test: wget -nv --tries=1 --spider http://127.0.0.1:8080/Jack/status/20 || exit 1
interval: 30s
Expand All @@ -23,11 +24,13 @@ services:
- no-new-privileges:true
cap_drop:
- ALL
networks: [nitter_network]

nitter-redis:
image: redis:6-alpine
container_name: nitter-redis
command: redis-server --save 60 1 --loglevel warning
networks: [nitter_network]
volumes:
- nitter-redis:/data
restart: unless-stopped
Expand All @@ -45,3 +48,7 @@ services:

volumes:
nitter-redis:

networks:
nitter_network:
external: true

0 comments on commit 723efb3

Please sign in to comment.