Skip to content

Commit

Permalink
deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
chkpwd committed Feb 26, 2024
1 parent 431df55 commit 12743b3
Show file tree
Hide file tree
Showing 4 changed files with 637 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build Exporter

on:
push:
tags: ['v*']
pull_request:
workflow_dispatch:
inputs:
push:
description: 'Push'
required: false
type: boolean
default: true

env:
REGISTRY: ghcr.io
IMAGE_NAME: apex-legends-exporter

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4

- uses: docker/setup-qemu-action@v3

- uses: docker/setup-buildx-action@v3

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=ref,event=tag
type=ref,event=pr
- name: Build and push image
uses: docker/build-push-action@v5
with:
push: ${{ inputs.push != 'false' }} # is null if trigger != workflow_dispatch
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
platforms: linux/amd64,linux/arm64
cache-from: |
type=gha
type=gha,scope=main
cache-to: type=gha,mode=max
provenance: false
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.12-slim-bookworm

ENV PYTHONUNBUFFERED=1

ENV API_KEY=
ENV USER_ID=
ENV PLAYER_NAME=
ENV PLATFORM=
ENV DEBUG=false

WORKDIR /app

COPY requirements.txt .

RUN pip install --no-cache-dir -r requirements.txt

COPY server/ .

EXPOSE 5000

ENTRYPOINT [ "python", "main.py" ]
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
prometheus_client
requests
Loading

0 comments on commit 12743b3

Please sign in to comment.