@@ -26,21 +26,21 @@ jobs:
2626 pull-requests : write
2727
2828 steps :
29- - uses : actions/checkout@v6
30- with :
31- show-progress : false
32- fetch-depth : 0
33-
34- - uses : actions/setup-node@v6
35- with :
36- node-version : 24.x
37- cache : npm
38-
39- - run : npm ci
40- env :
41- YOUTUBE_DL_SKIP_DOWNLOAD : true
42- - run : npm run ci
43- - run : npm test
29+ - uses : actions/checkout@v6
30+ with :
31+ show-progress : false
32+ fetch-depth : 0
33+
34+ - uses : actions/setup-node@v6
35+ with :
36+ node-version : 24.x
37+ cache : npm
38+
39+ - run : npm ci
40+ env :
41+ YOUTUBE_DL_SKIP_DOWNLOAD : true
42+ - run : npm run ci
43+ - run : npm test
4444
4545 build :
4646 name : Build
@@ -57,55 +57,57 @@ jobs:
5757 image-digest : ${{ steps.build.outputs.digest }}
5858
5959 steps :
60- - uses : actions/checkout@v6
61- with :
62- show-progress : false
63-
64- - uses : docker/setup-qemu-action@v3
65- - uses : docker/setup-buildx-action@v3
66- - uses : docker/login-action@v3
67- with :
68- registry : " ghcr.io"
69- username : ${{ github.actor }}
70- password : ${{ secrets.GITHUB_TOKEN }}
71-
72- - name : Docker meta
73- id : meta
74- uses : docker/metadata-action@v5
75- with :
76- images : |
77- ghcr.io/nulldev/csz-bot
78- tags : |
79- type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
80- type=ref,event=branch
81- type=ref,event=pr
82- type=semver,pattern={{version}}
83- type=semver,pattern={{major}}.{{minor}}
84-
85- - name : Extract tag
86- id : tag
87- env :
88- INPUT_TAGS : ${{ steps.meta.outputs.tags }}
89- run : |
90- first=$(echo "$INPUT_TAGS" | head -n 1)
91-
92- echo "first=$first" >> "$GITHUB_OUTPUT"
93-
94-
95- - name : Build and export
96- uses : docker/build-push-action@v6
97- id : build
98- with :
99- push : ${{ !github.event.repository.fork }}
100- pull : true
101- tags : ${{ steps.meta.outputs.tags }}
102- labels : ${{ steps.meta.outputs.labels }}
103- build-args : |
104- RELEASE_IDENTIFIER=${{ github.sha }}
105- BUILD_NUMBER=${{ github.run_number }}
106- load : true
107- cache-from : type=gha
108- cache-to : type=gha,mode=max
60+ - uses : actions/checkout@v6
61+ with :
62+ show-progress : false
63+
64+ - uses : docker/setup-qemu-action@v3
65+ - uses : docker/setup-buildx-action@v3
66+ - uses : docker/login-action@v3
67+ with :
68+ registry : " ghcr.io"
69+ username : ${{ github.actor }}
70+ password : ${{ secrets.GITHUB_TOKEN }}
71+
72+ - name : Docker meta
73+ id : meta
74+ uses : docker/metadata-action@v5
75+ with :
76+ images : |
77+ ghcr.io/nulldev/csz-bot
78+ tags : |
79+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
80+ type=ref,event=branch
81+ type=ref,event=pr
82+ type=semver,pattern={{version}}
83+ type=semver,pattern={{major}}.{{minor}}
84+
85+ - name : Extract tag
86+ id : tag
87+ env :
88+ INPUT_TAGS : ${{ steps.meta.outputs.tags }}
89+ run : |
90+ first=$(echo "$INPUT_TAGS" | head -n 1)
91+
92+ echo "first=$first" >> "$GITHUB_OUTPUT"
93+
94+
95+ - name : Build and export
96+ uses : docker/build-push-action@v6
97+ id : build
98+ with :
99+ # context needed, so we use path context instead of git context, so .dockerignore is respected
100+ context : " ."
101+ push : ${{ !github.event.repository.fork }}
102+ pull : true
103+ tags : ${{ steps.meta.outputs.tags }}
104+ labels : ${{ steps.meta.outputs.labels }}
105+ build-args : |
106+ RELEASE_IDENTIFIER=${{ github.sha }}
107+ BUILD_NUMBER=${{ github.run_number }}
108+ load : true
109+ cache-from : type=gha
110+ cache-to : type=gha,mode=max
109111
110112 deploy-e2e :
111113 name : Deploy e2e
@@ -120,56 +122,56 @@ jobs:
120122 name : e2e
121123
122124 steps :
123- - uses : actions/checkout@v6
124- with :
125- show-progress : false
126-
127- - name : Update configuration
128- env :
129- DISCORD_TOKEN : ${{ secrets.CI_BOT_TOKEN }}
130- DISCORD_CLIENT_ID : ${{ secrets.CI_CLIENT_ID }}
131- PR_ID : ${{ github.event.number }}
132- run : |
133- envsubst < .github/config.json > config.json
134-
135- - name : Read config.json
136- id : config
137- uses : juliangruber/read-file-action@v1
138- with :
139- path : ./config.json
140-
141- - name : Build args
142- id : args
143- env :
144- DRY_RUN : ${{ github.ref == 'refs/heads/master' }}
145- run : |
146- args=""
147-
148- if [[ $DRY_RUN = true ]]; then
149- args="--dry-run"
150- fi
151-
152- echo "args=$args" >> "$GITHUB_OUTPUT"
153-
154- - name : Deploy CSZ Bot
155- uses : appleboy/ssh-action@823bd89e131d8d508129f9443cad5855e9ba96f0
156- env :
157- BOT_HOME_PATH : /home/csc
158- EPHEMERAL_BOT_CONFIG : ${{ steps.config.outputs.content }}
159- BOT_ARGS : ${{ steps.args.outputs.args }}
160- BOT_IMAGE : ${{ needs.build.outputs.image-tag }}
161- with :
162- host : ${{ secrets.SSH_HOST }}
163- username : ${{ secrets.SSH_USERNAME }}
164- key : ${{ secrets.SSH_KEY }}
165- port : ${{ secrets.SSH_PORT }}
166- envs : BOT_HOME_PATH,EPHEMERAL_BOT_CONFIG,BOT_ARGS,BOT_IMAGE
167- script : ${{ env.BOT_HOME_PATH }}/.infra/deploy-ephemeral.sh
168-
169- - name : Comment PR
170- uses : thollander/actions-comment-pull-request@v3
171- if : ${{ github.event_name == 'pull_request' }}
172- with :
173- comment-tag : discord-invite
174- message : |
175- Hallo, hier kannst du jetzt deine tolle neue Funktion testen: https://discord.gg/pJjfF6n2ec
125+ - uses : actions/checkout@v6
126+ with :
127+ show-progress : false
128+
129+ - name : Update configuration
130+ env :
131+ DISCORD_TOKEN : ${{ secrets.CI_BOT_TOKEN }}
132+ DISCORD_CLIENT_ID : ${{ secrets.CI_CLIENT_ID }}
133+ PR_ID : ${{ github.event.number }}
134+ run : |
135+ envsubst < .github/config.json > config.json
136+
137+ - name : Read config.json
138+ id : config
139+ uses : juliangruber/read-file-action@v1
140+ with :
141+ path : ./config.json
142+
143+ - name : Build args
144+ id : args
145+ env :
146+ DRY_RUN : ${{ github.ref == 'refs/heads/master' }}
147+ run : |
148+ args=""
149+
150+ if [[ $DRY_RUN = true ]]; then
151+ args="--dry-run"
152+ fi
153+
154+ echo "args=$args" >> "$GITHUB_OUTPUT"
155+
156+ - name : Deploy CSZ Bot
157+ uses : appleboy/ssh-action@0ff4204d59e8e51228ff73bce53f80d53301dee2
158+ env :
159+ BOT_HOME_PATH : /home/csc
160+ EPHEMERAL_BOT_CONFIG : ${{ steps.config.outputs.content }}
161+ BOT_ARGS : ${{ steps.args.outputs.args }}
162+ BOT_IMAGE : ${{ needs.build.outputs.image-tag }}
163+ with :
164+ host : ${{ secrets.SSH_HOST }}
165+ username : ${{ secrets.SSH_USERNAME }}
166+ key : ${{ secrets.SSH_KEY }}
167+ port : ${{ secrets.SSH_PORT }}
168+ envs : BOT_HOME_PATH,EPHEMERAL_BOT_CONFIG,BOT_ARGS,BOT_IMAGE
169+ script : ${{ env.BOT_HOME_PATH }}/.infra/deploy-ephemeral.sh
170+
171+ - name : Comment PR
172+ uses : thollander/actions-comment-pull-request@v3
173+ if : ${{ github.event_name == 'pull_request' }}
174+ with :
175+ comment-tag : discord-invite
176+ message : |
177+ Hallo, hier kannst du jetzt deine tolle neue Funktion testen: https://discord.gg/pJjfF6n2ec
0 commit comments