-
Notifications
You must be signed in to change notification settings - Fork 526
76 lines (66 loc) · 2.53 KB
/
Copy pathcloud-image.yml
File metadata and controls
76 lines (66 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Publish Engram Cloud Image
on:
push:
tags:
- "v*"
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
publish-ghcr:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Detect default-branch release tag
id: refcheck
shell: bash
run: |
if [[ "${GITHUB_REF}" != refs/tags/v* ]]; then
echo "is_default_branch_tag=false" >> "$GITHUB_OUTPUT"
exit 0
fi
if git branch -r --contains "${GITHUB_SHA}" | grep -q "origin/main"; then
echo "is_default_branch_tag=true" >> "$GITHUB_OUTPUT"
else
echo "is_default_branch_tag=false" >> "$GITHUB_OUTPUT"
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/gentleman-programming/engram
tags: |
type=raw,value=latest,enable=${{ steps.refcheck.outputs.is_default_branch_tag == 'true' }}
type=ref,event=tag
type=semver,pattern={{version}},value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=semver,pattern={{major}}.{{minor}},value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=semver,pattern={{major}},value=${{ github.ref_name }},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=sha,prefix=sha-,enable=${{ github.event_name == 'workflow_dispatch' }}
labels: |
org.opencontainers.image.title=Engram Cloud
org.opencontainers.image.description=Project-scoped sync and dashboard runtime for Engram Cloud.
org.opencontainers.image.source=https://github.com/gentleman-programming/engram
org.opencontainers.image.licenses=MIT
- name: Build and push multi-arch image
uses: docker/build-push-action@v7
with:
context: .
file: docker/cloud/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}