flora is a fast and secure runtime that lets you write discord bots for your servers, with a rich TypeScript SDK, without worrying about running infrastructure. [mirror]
1name: Publish Runtime
2
3on:
4 workflow_dispatch:
5 inputs:
6 image_tag:
7 description: 'Container tag to publish to ghcr.io'
8 required: true
9 type: string
10
11permissions:
12 contents: read
13 packages: write
14
15jobs:
16 publish-runtime:
17 runs-on: ubuntu-latest
18
19 steps:
20 - name: Check out repository
21 uses: actions/checkout@v4
22 with:
23 submodules: recursive
24
25 - name: Set up Docker Buildx
26 uses: docker/setup-buildx-action@v3
27
28 - name: Normalize image name
29 id: image
30 env:
31 REPOSITORY_OWNER: ${{ github.repository_owner }}
32 run: |
33 echo "name=ghcr.io/${REPOSITORY_OWNER,,}/flora" >> "$GITHUB_OUTPUT"
34
35 - name: Log in to GitHub Container Registry
36 uses: docker/login-action@v3
37 with:
38 registry: ghcr.io
39 username: ${{ github.actor }}
40 password: ${{ secrets.GITHUB_TOKEN }}
41
42 - name: Materialize submodule git dirs for Docker
43 run: |
44 mapfile -t submodule_entries < <(
45 git submodule foreach --recursive --quiet \
46 'printf "%s\t%s\n" "$displaypath" "$(git rev-parse --absolute-git-dir)"'
47 )
48
49 for submodule_entry in "${submodule_entries[@]}"; do
50 submodule_path="${submodule_entry%%$'\t'*}"
51 submodule_gitdir="${submodule_entry#*$'\t'}"
52 git_metadata_path="$submodule_path/.git"
53
54 if [ -f "$git_metadata_path" ]; then
55 rm "$git_metadata_path"
56 mkdir "$git_metadata_path"
57 cp -a "$submodule_gitdir"/. "$git_metadata_path/"
58 fi
59
60 if [ -f "$git_metadata_path/config" ]; then
61 git config --file "$git_metadata_path/config" --unset core.worktree || true
62 fi
63 done
64
65 - name: Build and push runtime image
66 uses: docker/build-push-action@v6
67 with:
68 context: .
69 file: apps/runtime/Dockerfile
70 push: true
71 tags: ${{ steps.image.outputs.name }}:${{ inputs.image_tag }}
72 labels: |
73 org.opencontainers.image.source=https://github.com/${{ github.repository }}
74 org.opencontainers.image.revision=${{ github.sha }}
75 cache-from: type=gha,scope=publish-runtime
76 cache-to: type=gha,scope=publish-runtime,mode=max
77
78 - name: Print published image
79 run: echo "Published ${{ steps.image.outputs.name }}:${{ inputs.image_tag }}"