-
-
Notifications
You must be signed in to change notification settings - Fork 308
97 lines (83 loc) · 3.14 KB
/
docker-version.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
88
89
90
91
92
93
94
95
96
97
name: Docker Version Build
on:
create:
tags:
- v*
jobs:
docker-build-version:
if: ${{ startsWith(github.ref, 'refs/tags/v1') || startsWith(github.ref, 'refs/tags/v2') }}
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Build and Push
id: docker_build
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: kometateam/kometa:${{ steps.get_version.outputs.VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Discord Success Notification
uses: Kometa-Team/discord-notifications@master
if: success()
with:
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
title: "${{ vars.REPO_NAME }} ${{ steps.get_version.outputs.VERSION }}: ${{ vars.TEXT_SUCCESS }}"
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
color: ${{ vars.COLOR_SUCCESS }}
username: ${{ vars.BOT_NAME }}
avatar_url: ${{ vars.BOT_IMAGE }}
author: ${{ vars.DOCKER_NAME }}
author_icon_url: ${{ vars.DOCKER_IMAGE }}
- name: Discord Failure Notification
uses: Kometa-Team/discord-notifications@master
if: failure()
with:
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }}
message: ${{ vars.BUILD_FAILURE_ROLE }}
title: "${{ vars.REPO_NAME }} ${{ steps.get_version.outputs.VERSION }}: ${{ vars.TEXT_FAILURE }}"
url: https://github.com/Kometa-Team/${{ vars.REPO_NAME }}/actions/runs/${{ github.run_id }}
color: ${{ vars.COLOR_FAILURE }}
username: ${{ vars.BOT_NAME }}
avatar_url: ${{ vars.BOT_IMAGE }}
author: ${{ vars.DOCKER_NAME }}
author_icon_url: ${{ vars.DOCKER_IMAGE }}
- name: Checkout Configs Repo
uses: actions/checkout@v4
with:
repository: Kometa-Team/Community-Configs
token: ${{ secrets.PAT }}
path: kometaconfigs
- name: Create & Push Tag
working-directory: ./kometaconfigs
run: |
git tag ${{ steps.get_version.outputs.VERSION }}
git push origin ${{ steps.get_version.outputs.VERSION }}
- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG
token: ${{ secrets.PAT }}
tag_name: ${{ steps.get_version.outputs.VERSION }}