Skip to content

Commit 8653eef

Browse files
committed
Prepare application for multi docker execution
1 parent fab48bf commit 8653eef

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

.github/workflows/gradle-publish.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
env:
1414
REGISTRY: ghcr.io
1515
IMAGE_NAME: ${{ github.repository }}
16+
SERVICE_NAME: radio
1617
REMOTE_PATH: /opt/dockerfiles/radio
1718
GHCR_USER: splayfery
1819
TAGS: latest
@@ -73,7 +74,7 @@ jobs:
7374
uses: actions/delete-package-versions@v5
7475
continue-on-error: true
7576
with:
76-
package-name: radio
77+
package-name: ${{ env.SERVICE_NAME }}
7778
package-type: container
7879
min-versions-to-keep: 1
7980

@@ -143,23 +144,20 @@ jobs:
143144
- name: Set lowercase IMAGE_NAME
144145
run: echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
145146

146-
- name: Sync Docker Compose File
147-
run: rsync -avz docker-compose.yaml ${{ secrets.USERNAME }}@${{ secrets.HOST }}:${{ env.REMOTE_PATH }}
147+
# - name: Sync Docker Compose File
148+
# run: rsync -avz docker-compose.yaml ${{ secrets.USERNAME }}@${{ secrets.HOST }}:${{ env.REMOTE_PATH }}
148149

149150
- name: Deploy and Restart Container
150151
run: |
151152
ssh staging "
152153
echo '${{ secrets.GHCR_TOKEN }}' | docker login ghcr.io -u ${{ env.GHCR_USER }} --password-stdin &&
153154
154-
# Stop running container
155-
docker compose -f ${REMOTE_PATH}/docker-compose.yaml down || true &&
156-
157155
# Pull latest image
158156
docker pull ${REGISTRY}/${IMAGE_NAME}:${{ env.TAGS }} &&
159157
158+
# Re-Pull und Restart container service
159+
docker compose -f {REMOTE_PATH}/docker-compose.yaml up -d --force-recreate --no-deps ${{ env.SERVICE_NAME }} &&
160+
160161
# Remove unused old images
161-
docker image prune -af &&
162-
163-
# Start new container
164-
docker compose -f ${REMOTE_PATH}/docker-compose.yaml up -d
162+
docker image prune -af
165163
"

src/main/java/de/splayfer/radio/Radio.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class Radio {
2626

2727
public static void main(String[] args) throws InterruptedException {
2828

29-
builder = JDABuilder.createDefault(System.getenv("BOT_TOKEN"))
29+
builder = JDABuilder.createDefault(System.getenv("RADIO_BOT_TOKEN"))
3030
.setStatus(OnlineStatus.ONLINE)
3131
.setActivity(Activity.streaming("🌀SPLΛYFUNITY🌀", "https://twitch.tv/splayfer"))
3232
.addEventListeners(new ReadyEventClass());

0 commit comments

Comments
 (0)