-
-
Notifications
You must be signed in to change notification settings - Fork 11
52 lines (49 loc) · 1.72 KB
/
deploy.yml
File metadata and controls
52 lines (49 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
name: Deploy
on:
release:
types:
- created
jobs:
check-requirements:
name: Check Requirements
runs-on: ubuntu-24.04
steps:
- name: Set Version Tag
run: echo "API_TAG=$(echo $GITHUB_REF | awk -F '/' '{print $NF}')" >> $GITHUB_ENV
- name: Check Tag Convention
run: '[[ "${API_TAG:0:1}" == "v" ]] || exit 1'
build-image:
name: Build Image
runs-on: ubuntu-24.04
needs: check-requirements
steps:
- uses: actions/checkout@v5
- name: Parse API Version
run: echo "API_VERSION=$(echo $GITHUB_REF | awk -F '/' '{print $NF}' | cut -c 2-)" >> $GITHUB_ENV
- name: Docker Login
run: |
echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
echo ${{ secrets.GHCRIO_ACCESS_TOKEN }} | docker login ghcr.io -u ${{ secrets.GHCRIO_USERNAME }} --password-stdin
- name: Build Image
run: docker build -t steamcmd/api:latest -t ghcr.io/steamcmd/api:latest .
# deploy
- name: Tag Image
run: |
docker tag steamcmd/api:latest steamcmd/api:$API_VERSION
docker tag ghcr.io/steamcmd/api:latest ghcr.io/steamcmd/api:$API_VERSION
- name: Push Image
run: |
docker push steamcmd/api --all-tags
docker push ghcr.io/steamcmd/api --all-tags
update-readme:
name: Update Readme
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v4
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERHUB_REPOSITORY: steamcmd/api