add docker build/remove unused flows

This commit is contained in:
gmega 2024-10-29 19:09:15 -03:00
parent 8b02864b51
commit 295503e8e4
No known key found for this signature in database
GPG Key ID: 6290D34EAD824B18
4 changed files with 58 additions and 59 deletions

47
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: Docker
on:
push:
branches:
- master
workflow_dispatch:
env:
DOCKER_FILE: docker/bittorrent-tracker.Dockerfile
DOCKER_REPO: codexstorage/bittorrent-tracker
jobs:
docker:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Setup Docker Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REPO }}
flavor: |
latest=true
tags: |
type=sha
- name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKER_FILE }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -1,36 +0,0 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install dependencies
run: npm i
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

View File

@ -1,23 +0,0 @@
name: Mark stale issues and pull requests
on:
schedule:
- cron: '0 12 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?'
stale-pr-message: 'Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?'
exempt-issue-labels: accepted,blocked,bug,dependency,enhancement,'help wanted',question,security,meta
exempt-pr-labels: accepted,blocked,bug,dependency,enhancement,'help wanted',question,security,meta
stale-issue-label: 'stale'
stale-pr-label: 'stale'

View File

@ -0,0 +1,11 @@
FROM node:22-alpine3.20
ENV TRACKER_PORT=8000
RUN apk add gcompat
WORKDIR /opt/bitorrent-tracker
COPY . ./
RUN npm install
ENTRYPOINT ["bash", "-c", "/opt/bittorrent-tracker/bin/cmd.js --port ${TRACKER_PORT}"]