Skip to content

Commit ed6779a

Browse files
committed
Remove obsolete deploy tasks and add GHCR registry
1 parent 23e3301 commit ed6779a

File tree

3 files changed

+45
-34
lines changed

3 files changed

+45
-34
lines changed

.github/workflows/deploy.yml

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
check-requirements:
1010
name: Check Requirements
11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-24.04
1212
steps:
1313
- name: Set Version Tag
1414
run: echo "API_TAG=$(echo $GITHUB_REF | awk -F '/' '{print $NF}')" >> $GITHUB_ENV
@@ -17,25 +17,31 @@ jobs:
1717

1818
build-image:
1919
name: Build Image
20-
runs-on: ubuntu-22.04
20+
runs-on: ubuntu-24.04
2121
needs: check-requirements
2222
steps:
2323
- uses: actions/checkout@v4
2424
- name: Parse API Version
2525
run: echo "API_VERSION=$(echo $GITHUB_REF | awk -F '/' '{print $NF}' | cut -c 2-)" >> $GITHUB_ENV
2626
- name: Docker Login
27-
run: echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
27+
run: |
28+
echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
29+
echo ${{ secrets.GHCRIO_ACCESS_TOKEN }} | docker login ghcr.io -u ${{ secrets.GHCRIO_USERNAME }} --password-stdin
2830
- name: Build Image
29-
run: docker build -t steamcmd/api:latest .
31+
run: docker build -t steamcmd/api:latest -t ghcr.io/steamcmd/api:latest .
3032
# deploy
3133
- name: Tag Image
32-
run: docker tag steamcmd/api:latest steamcmd/api:$API_VERSION
34+
run: |
35+
docker tag steamcmd/api:latest steamcmd/api:$API_VERSION
36+
docker tag ghcr.io/steamcmd/api:latest ghcr.io/steamcmd/api:$API_VERSION
3337
- name: Push Image
34-
run: docker push steamcmd/api --all-tags
38+
run: |
39+
docker push steamcmd/api --all-tags
40+
docker push ghcr.io/steamcmd/api --all-tags
3541
3642
update-readme:
3743
name: Update Readme
38-
runs-on: ubuntu-22.04
44+
runs-on: ubuntu-24.04
3945
steps:
4046
- uses: actions/checkout@v4
4147
- name: Update Docker Hub Description
@@ -44,28 +50,3 @@ jobs:
4450
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
4551
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
4652
DOCKERHUB_REPOSITORY: steamcmd/api
47-
48-
deploy-fly:
49-
name: Deploy Fly.io
50-
runs-on: ubuntu-22.04
51-
needs: [check-requirements, build-image]
52-
steps:
53-
- uses: actions/checkout@v4
54-
- uses: superfly/flyctl-actions/setup-flyctl@master
55-
- name: Parse API Version
56-
run: echo "API_VERSION=$(echo $GITHUB_REF | awk -F '/' '{print $NF}' | cut -c 2-)" >> $GITHUB_ENV
57-
- name: Deploy API on Fly.io
58-
run: flyctl deploy --app steamcmd --image steamcmd/api:${{ env.API_VERSION }} -e VERSION=${{ env.API_VERSION }}
59-
env:
60-
FLY_API_TOKEN: ${{ secrets.FLY_ACCESS_TOKEN }}
61-
62-
deploy-render:
63-
name: Deploy Render.com
64-
runs-on: ubuntu-22.04
65-
needs: [check-requirements, build-image]
66-
steps:
67-
- uses: actions/checkout@v4
68-
- name: Parse API Version
69-
run: echo "API_VERSION=$(echo $GITHUB_REF | awk -F '/' '{print $NF}' | cut -c 2-)" >> $GITHUB_ENV
70-
- name: Deploy API on Render.com
71-
run: curl https://api.render.com/deploy/${{ secrets.RENDER_SERVICE_ID }}?key=${{ secrets.RENDER_API_KEY }}&imgURL=docker.io%2Fsteamcmd%2Fapi%40${{ env.API_VERSION }}

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ on:
1111
jobs:
1212
test-image:
1313
name: Test Image
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-24.04
1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Build Image
1818
run: docker build -t steamcmd/api:latest .
1919

2020
python-lint:
2121
name: Python Lint
22-
runs-on: ubuntu-22.04
22+
runs-on: ubuntu-24.04
2323
steps:
2424
- uses: actions/checkout@v4
2525
- uses: jpetrucciani/ruff-check@main

src/_test.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env python3
2+
3+
import redis
4+
5+
rds = redis.Redis(
6+
host="steamcmd-redis-svc",
7+
port=6379,
8+
password="4jch9e2w4xptUqCSTq8lnyX",
9+
db=0
10+
)
11+
12+
# Initialize cursor
13+
cursor = 0
14+
false_apps = []
15+
16+
# Use SCAN to iterate through keys that start with "app."
17+
while True:
18+
cursor, apps = rds.scan(cursor, match='app.*')
19+
for app in apps:
20+
# Check if the value of the app is "false"
21+
if rds.get(app) == b'false':
22+
app = app.decode("UTF-8")
23+
app = app.split(".")[1]
24+
false_apps.append(int(app))
25+
26+
if cursor == 0:
27+
break
28+
29+
for app in false_apps:
30+
print(app)

0 commit comments

Comments
 (0)