Skip to content

Commit 76aa85d

Browse files
committed
Try to do a one time setup.
1 parent 8a83e33 commit 76aa85d

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
uses: docker/login-action@v3
3131
with:
3232
registry: ghcr.io
33-
username: ${{ github.actor }}
34-
password: ${{ secrets.GITHUB_TOKEN }}
33+
username: ${{ env.KAMAL_REGISTRY_USERNAME }}
34+
password: ${{ env.KAMAL_REGISTRY_PASSWORD }}
3535

3636
- name: Setup .NET
3737
uses: actions/setup-dotnet@v3
@@ -67,6 +67,17 @@ jobs:
6767
- name: Ensure file permissions
6868
run: kamal server exec --no-interactive "mkdir -p /opt/docker/${{ env.repository_name }}/App_Data && chown -R 1654:1654 /opt/docker/${{ env.repository_name }}/App_Data"
6969

70+
# This ensures the web.env has been setup ready for deployments
71+
- name: Check if first run and execute kamal app boot if necessary
72+
run: |
73+
FIRST_RUN_FILE="/opt/docker/${{ env.repository_name }}/.first_run"
74+
if ! kamal server exec --no-interactive "test -f $FIRST_RUN_FILE"; then
75+
kamal server exec --no-interactive "touch $FIRST_RUN_FILE"
76+
kamal app boot > /dev/null 2>&1 || true
77+
else
78+
echo "Not first run, skipping kamal app boot"
79+
fi
80+
7081
- name: Migration
7182
run: kamal app exec --no-reuse --no-interactive --version=latest "--AppTasks=migrate"
7283

0 commit comments

Comments
 (0)