Skip to content

Commit 637ca12

Browse files
authored
Merge pull request #860 from Yacht-sh/develop
Develop
2 parents 25a4207 + 15e9097 commit 637ca12

2 files changed

Lines changed: 18 additions & 112 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
name: Build And Publish Images
1+
name: Verify And Publish Main Image
22

33
on:
44
push:
55
branches:
66
- master
7-
- develop
8-
workflow_dispatch:
97

108
concurrency:
11-
group: image-publish-${{ github.ref_name }}
9+
group: master-image-publish
1210
cancel-in-progress: true
1311

1412
permissions:
@@ -176,24 +174,12 @@ jobs:
176174
- name: Prepare image metadata
177175
id: prep
178176
run: |
179-
timestamp="$(date -u +%Y%m%d-%H%M%S)"
180-
if [ "${GITHUB_REF_NAME}" = "master" ]; then
181-
channel_tag="latest"
182-
version_tag="${timestamp}"
183-
app_version="${timestamp}"
184-
elif [ "${GITHUB_REF_NAME}" = "develop" ]; then
185-
channel_tag="dev-latest"
186-
version_tag="dev-${timestamp}"
187-
app_version="dev-${timestamp}"
188-
else
189-
echo "Unsupported ref ${GITHUB_REF_NAME}" >&2
190-
exit 1
191-
fi
177+
short_sha="${GITHUB_SHA::12}"
192178
193179
{
194-
echo "channel_tag=${channel_tag}"
195-
echo "version_tag=${version_tag}"
196-
echo "app_version=${app_version}"
180+
echo "channel_tag=latest"
181+
echo "version_tag=sha-${short_sha}"
182+
echo "app_version=${short_sha}"
197183
echo "owner_lc=${GITHUB_REPOSITORY_OWNER,,}"
198184
} >> "$GITHUB_OUTPUT"
199185
@@ -237,77 +223,3 @@ jobs:
237223
cache-to: type=gha,mode=max,scope=main-image-${{ github.ref_name }}
238224
provenance: mode=max
239225
sbom: true
240-
241-
publish-agent-image:
242-
name: Publish Agent Image
243-
runs-on: ubuntu-latest
244-
needs:
245-
- verify-agent
246-
permissions:
247-
contents: read
248-
packages: write
249-
attestations: write
250-
id-token: write
251-
steps:
252-
- name: Checkout code
253-
uses: actions/checkout@v5
254-
255-
- name: Prepare image metadata
256-
id: prep
257-
run: |
258-
timestamp="$(date -u +%Y%m%d-%H%M%S)"
259-
if [ "${GITHUB_REF_NAME}" = "master" ]; then
260-
channel_tag="latest"
261-
version_tag="${timestamp}"
262-
elif [ "${GITHUB_REF_NAME}" = "develop" ]; then
263-
channel_tag="dev-latest"
264-
version_tag="dev-${timestamp}"
265-
else
266-
echo "Unsupported ref ${GITHUB_REF_NAME}" >&2
267-
exit 1
268-
fi
269-
270-
{
271-
echo "channel_tag=${channel_tag}"
272-
echo "version_tag=${version_tag}"
273-
echo "owner_lc=${GITHUB_REPOSITORY_OWNER,,}"
274-
} >> "$GITHUB_OUTPUT"
275-
276-
- name: Extract image metadata
277-
id: meta
278-
uses: docker/metadata-action@v5
279-
with:
280-
images: ghcr.io/${{ steps.prep.outputs.owner_lc }}/yacht-agent
281-
tags: |
282-
type=raw,value=${{ steps.prep.outputs.channel_tag }}
283-
type=raw,value=${{ steps.prep.outputs.version_tag }}
284-
labels: |
285-
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
286-
org.opencontainers.image.revision=${{ github.sha }}
287-
288-
- name: Set up QEMU
289-
uses: docker/setup-qemu-action@v3
290-
291-
- name: Set up Docker Buildx
292-
uses: docker/setup-buildx-action@v3
293-
294-
- name: Log in to GitHub Container Registry
295-
uses: docker/login-action@v4
296-
with:
297-
registry: ghcr.io
298-
username: ${{ secrets.GHCR_USERNAME != '' && secrets.GHCR_USERNAME || github.actor }}
299-
password: ${{ secrets.GHCR_TOKEN != '' && secrets.GHCR_TOKEN || secrets.GITHUB_TOKEN }}
300-
301-
- name: Build and push agent image
302-
uses: docker/build-push-action@v6
303-
with:
304-
context: .
305-
file: ./agent/Dockerfile
306-
platforms: linux/amd64,linux/arm64
307-
push: true
308-
tags: ${{ steps.meta.outputs.tags }}
309-
labels: ${{ steps.meta.outputs.labels }}
310-
cache-from: type=gha,scope=agent-image-${{ github.ref_name }}
311-
cache-to: type=gha,mode=max,scope=agent-image-${{ github.ref_name }}
312-
provenance: mode=max
313-
sbom: true

docs/ci-cd.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CI/CD and Image Publishing
1+
# CI/CD and Main Image Publishing
22

33
## Registries
44

@@ -8,10 +8,6 @@ Main image:
88

99
- `ghcr.io/<owner>/yacht`
1010

11-
Agent image:
12-
13-
- `ghcr.io/<owner>/yacht-agent`
14-
1511
## Workflow
1612

1713
Current image publishing uses:
@@ -20,9 +16,7 @@ Current image publishing uses:
2016

2117
Trigger:
2218

23-
- push to `develop`
2419
- push to `master`
25-
- manual dispatch
2620

2721
## Verification Stages
2822

@@ -43,19 +37,19 @@ Before publishing, the workflow verifies:
4337

4438
## Publish Tags
4539

46-
On `develop`:
40+
On each push to `master`:
41+
42+
- `yacht:latest`
43+
- `yacht:sha-<12-char-commit-sha>`
4744

48-
- `yacht:dev-latest`
49-
- `yacht:dev-<YYYYMMDD-HHMMSS>`
50-
- `yacht-agent:dev-latest`
51-
- `yacht-agent:dev-<YYYYMMDD-HHMMSS>`
45+
## Target Platforms
5246

53-
On `master`:
47+
The published main image targets:
5448

55-
- `yacht:latest`
56-
- `yacht:<YYYYMMDD-HHMMSS>`
57-
- `yacht-agent:latest`
58-
- `yacht-agent:<YYYYMMDD-HHMMSS>`
49+
- `linux/amd64`
50+
- `linux/arm64`
51+
52+
The workflow does not publish `arm/v7`.
5953

6054
## Supply Chain Metadata
6155

@@ -71,4 +65,4 @@ The workflows log in to GHCR with:
7165
- `GHCR_USERNAME` and `GHCR_TOKEN` when provided
7266
- otherwise `github.actor` and `GITHUB_TOKEN`
7367

74-
There is no Docker Hub publishing path in the current repo configuration.
68+
There is no Docker Hub publishing path in the current repo configuration, and the workflow no longer publishes a separate agent image.

0 commit comments

Comments
 (0)