forked from lichess-bot-devs/lichess-bot
-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (75 loc) · 2.89 KB
/
docker.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Docker CI
on:
workflow_run:
workflows: [Versioning]
types:
- completed
env:
GB_REGISTRY: ghcr.io
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- name: Assign defaultValue
run: |
version=$(grep -m1 '^lichess_bot_version: ' lib/versioning.yml | sed -n -e 's/^.*://p' | tr -d '[:space:]')
echo version="$version" >> "$GITHUB_ENV"
- name: show me docker tags.
run: |
echo "version:'"$version"'"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Login to Github container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GB_REGISTRY }}
username: ${{ secrets.GB_REPO_USER }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: build and push alpine image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
platforms: |
linux/amd64
linux/arm64
build-args: VARIANT=-alpine
push: true
tags: |
${{ vars.DOCKER_ORGANIZATION }}/${{ vars.DOCKER_IMG }}:alpine
${{ vars.DOCKER_ORGANIZATION }}/${{ vars.DOCKER_IMG }}:${{ env.version }}-alpine
${{ env.GB_REGISTRY }}/${{ vars.GHCR_DOCKER_ORGANIZATION }}/${{ vars.DOCKER_IMG }}:alpine
${{ env.GB_REGISTRY }}/${{ vars.GHCR_DOCKER_ORGANIZATION }}/${{ vars.DOCKER_IMG }}:${{ env.version }}-alpine
- name: build and push fat image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: |
${{ vars.DOCKER_ORGANIZATION }}/${{ vars.DOCKER_IMG }}:latest
${{ vars.DOCKER_ORGANIZATION }}/${{ vars.DOCKER_IMG }}:${{ env.version }}
${{ env.GB_REGISTRY }}/${{ vars.GHCR_DOCKER_ORGANIZATION }}/${{ vars.DOCKER_IMG }}:latest
${{ env.GB_REGISTRY }}/${{ vars.GHCR_DOCKER_ORGANIZATION }}/${{ vars.DOCKER_IMG }}:${{ env.version }}
- name: push README to Dockerhub
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_TOKEN }}
with:
destination_container_repo: lichessbotdevs/lichess-bot
provider: dockerhub
short_description: 'A bridge between Lichess API and chess engines'
readme_file: './wiki/How-to-use-the-Docker-image.md'