Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Commit fc5754e

Browse files
committed
added workflow
1 parent 246d557 commit fc5754e

File tree

3 files changed

+37
-14
lines changed

3 files changed

+37
-14
lines changed

.github/workflows/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1+
ARG TAG_NAME="dev"
2+
ARG GO_VERSION="1.22.3"
3+
14
# Build the go helper
2-
FROM golang:alpine AS build-helper
5+
FROM golang:${GO_VERSION}-alpine AS build-helper
36
WORKDIR /helper
4-
COPY ./ ./
7+
COPY go.mod go.sum ./
58
RUN go mod download
9+
COPY . .
610
RUN go build -o helper
711

812
# Build the bot
9-
FROM registry.coregame.de/core/core-event-0:latest
13+
FROM ghcr.io/42core-team/my-core-bot:${TAG_NAME}
1014
WORKDIR /bot
1115
COPY --from=build-helper /helper/helper ./helper
12-
COPY ./my-core-bot/Makefile ./Makefile
1316

1417
CMD ["./helper"]

.github/workflows/bot-client-image.yaml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,47 @@ name: "Build bot-client image"
33
on:
44
workflow_dispatch:
55
push:
6-
tags:
7-
- '**'
6+
branches:
7+
- dev
8+
- v2
9+
- "event-*"
10+
- "rush-*"
811

912
permissions:
1013
contents: read
14+
packages: write
1115

1216
concurrency:
13-
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
17+
group: "${{ github.workflow }} @ ${{ github.ref_name }}-${{ github.sha }}"
1418
cancel-in-progress: true
1519

1620
jobs:
17-
checkout:
21+
build-bot-client-image:
1822
runs-on: self-hosted
1923
env:
2024
PATH: "/vscode/vscode-server/bin/linux-x64/e7e037083ff4455cf320e344325dacb480062c3c/bin/remote-cli:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
2125
steps:
2226
- name: Checkout
2327
uses: actions/checkout@v4
2428
with:
25-
submodules: 'true'
29+
submodules: "true"
2630

27-
- name: Login to Registry
31+
- name: Login to GitHub Container Registry
2832
uses: docker/login-action@v3
2933
with:
30-
registry: registry.coregame.de
31-
username: ${{ secrets.REGISTRY_USERNAME }}
32-
password: ${{ secrets.REGISTRY_PASSWORD }}
34+
registry: ghcr.io
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Set up QEMU
39+
uses: docker/setup-qemu-action@v3
40+
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Set sha short
45+
id: vars
46+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
3347

3448
- name: Build and push
3549
uses: docker/build-push-action@v5
@@ -38,4 +52,8 @@ jobs:
3852
file: ./.github/workflows/Dockerfile
3953
platforms: linux/amd64, linux/arm64
4054
push: true
41-
tags: registry.coregame.de/core/bot-client:${{ github.ref_name }}, registry.coregame.de/core/bot-client:latest
55+
build-args: |
56+
TAG_NAME=${{ github.ref_name }}
57+
tags: |
58+
ghcr.io/42core-team/bot-client:${{ github.ref_name }}
59+
ghcr.io/42core-team/bot-client:${{ github.ref_name }}-${{ steps.vars.outputs.sha_short }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ go.work.sum
2525
/repo
2626
my-core-bot/*
2727
!my-core-bot/Makefile
28+
29+
.DS_Store

0 commit comments

Comments
 (0)