-
-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (38 loc) · 1.31 KB
/
release.yaml
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
name: Release
on:
push:
branches:
- master
jobs:
Release:
runs-on: ubuntu-latest
steps:
- name: Select release version
id: version
run: printf 'tag=aiarena/discordbot:%(%Y.%m.%d-%H.%M)T' >> $GITHUB_OUTPUT
- name: Check out repository code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish Docker image
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.version.outputs.tag }}
- name: Update Kubernetes descriptors
run: |
cp -vr kubernetes ${{ runner.temp }}
echo 'Setting version ${{ steps.version.outputs.tag }} in deployment descriptors'
sed -i -e 's|aiarena/discordbot|${{ steps.version.outputs.tag }}|g' ${{ runner.temp }}/kubernetes/deployment.yaml
git fetch
git switch kubernetes
rm -r ./*
cp -vr ${{ runner.temp }}/kubernetes/* .
git config --global user.name 'AI Arena'
git config --global user.email '[email protected]'
git add --all
git commit -m 'Release ${{ steps.version.outputs.tag }}'
git push