[READ ONLY MIRROR] Spark Social AppView Server
github.com/sprksocial/server
atproto
deno
hono
lexicon
1name: Build and Push AppView Image
2
3# Trigger only for tags starting with 'appview/v'
4on:
5 push:
6 branches:
7 - main
8
9jobs:
10 build-and-push-appview:
11 runs-on: ubuntu-latest
12 permissions:
13 contents: read
14 packages: write
15
16 steps:
17 - name: Checkout repository
18 uses: actions/checkout@v4
19 with:
20 fetch-depth: 0
21 - name: Extract Version from Tag
22 id: extract_version
23 run: |
24 # GITHUB_REF_NAME is like 'refs/tags/appview/v1.0.0'
25 # Or directly github.ref_name which is 'appview/v1.0.0'
26 TAG_NAME="${{ github.ref_name }}"
27 # Remove the known service prefix 'appview/'
28 VERSION=$(echo "$TAG_NAME" | sed 's#^appview/##')
29 echo "Extracted Version: $VERSION"
30 if [ -z "$VERSION" ]; then
31 echo "::error::Could not extract version from tag '$TAG_NAME'."
32 exit 1
33 fi
34 echo "version=${VERSION}" >> $GITHUB_OUTPUT
35 echo "ghcr_image_name=ghcr.io/${{ github.repository_owner }}/appview" >> $GITHUB_OUTPUT
36
37 - name: Log in to GitHub Container Registry
38 uses: docker/login-action@v3
39 with:
40 registry: ghcr.io
41 username: ${{ github.actor }}
42 password: ${{ secrets.GITHUB_TOKEN }}
43
44 - name: Set up QEMU
45 uses: docker/setup-qemu-action@v3
46
47 - name: Set up Docker Buildx
48 uses: docker/setup-buildx-action@v3
49
50 - name: Build and push Docker image for AppView
51 uses: docker/build-push-action@v6
52 with:
53 context: .
54 file: ./Dockerfile
55 push: true
56 platforms: linux/amd64,linux/arm64
57 cache-from: type=gha
58 cache-to: type=gha,mode=max
59 build-args: |
60 COMMIT_SHA=${{ github.sha }}
61 tags: |
62 ${{ steps.extract_version.outputs.ghcr_image_name }}:${{ steps.extract_version.outputs.version }}
63 ${{ steps.extract_version.outputs.ghcr_image_name }}:latest
64 ${{ steps.extract_version.outputs.ghcr_image_name }}:${{ github.sha }}
65 labels: |
66 org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
67 org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
68 org.opencontainers.image.revision=${{ github.sha }}
69 org.opencontainers.image.version=${{ steps.extract_version.outputs.version }}
70 org.opencontainers.image.title=appview
71
72 - name: Image Push Summary
73 run: |
74 echo "Successfully pushed appview:"
75 echo "Image: ${{ steps.extract_version.outputs.ghcr_image_name }}"
76 echo "Tags: ${{ steps.extract_version.outputs.version }}, latest"