Your music, beautifully tracked. All yours. (coming soon)
teal.fm
teal-fm
atproto
1# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2
3name: Build and Push Cadet
4
5on:
6 push:
7 branches: [main]
8 paths:
9 - "services/cadet/**"
10 - "Cargo.toml"
11 - "Cargo.lock"
12 - ".github/workflows/cadet.yml"
13 pull_request:
14 branches: [main]
15 paths:
16 - "services/cadet/**"
17 - "Cargo.toml"
18 - "Cargo.lock"
19 - ".github/workflows/cadet.yml"
20
21env:
22 REGISTRY: ghcr.io
23 IMAGE_NAME: ${{ github.repository }}/cadet
24
25jobs:
26 build-and-push:
27 runs-on: ubuntu-latest
28 permissions:
29 contents: read
30 packages: write
31
32 steps:
33 - name: Checkout repository
34 uses: actions/checkout@v4
35
36 - name: Log in to Container Registry
37 if: github.event_name != 'pull_request'
38 uses: docker/login-action@v3
39 with:
40 registry: ${{ env.REGISTRY }}
41 username: ${{ github.actor }}
42 password: ${{ secrets.GITHUB_TOKEN }}
43
44 - name: Extract metadata
45 id: meta
46 uses: docker/metadata-action@v5
47 with:
48 images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
49 tags: |
50 type=ref,event=branch
51 type=ref,event=pr
52 type=sha,prefix=sha-
53 type=raw,value=latest,enable={{is_default_branch}}
54
55 - name: Set up Docker Buildx
56 uses: docker/setup-buildx-action@v3
57
58 - name: Build and push Docker image
59 uses: docker/build-push-action@v5
60 with:
61 context: .
62 file: ./services/cadet/Dockerfile
63 push: ${{ github.event_name != 'pull_request' }}
64 tags: ${{ steps.meta.outputs.tags }}
65 labels: ${{ steps.meta.outputs.labels }}
66 platforms: linux/amd64,linux/arm64
67 cache-from: type=gha
68 cache-to: type=gha,mode=max