Skip to content

Commit 8ec0b2f

Browse files
committed
Added the workflow to push images following on the stage branch push.
1 parent 88dea5b commit 8ec0b2f

2 files changed

Lines changed: 87 additions & 0 deletions

File tree

.github/workflows/releases.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ jobs:
124124
if: startsWith(github.ref, 'refs/tags/')
125125
uses: docker/setup-buildx-action@v3
126126

127+
- name: Set up QEMU
128+
if: startsWith(github.ref, 'refs/tags/')
129+
uses: docker/setup-qemu-action@v3
130+
127131
- name: Log in to GHCR
128132
if: startsWith(github.ref, 'refs/tags/')
129133
uses: docker/login-action@v3
@@ -152,6 +156,7 @@ jobs:
152156
context: .
153157
file: ./Dockerfile
154158
push: true
159+
platforms: linux/amd64,linux/arm64
155160
tags: ${{ steps.meta_app.outputs.tags }}
156161
labels: ${{ steps.meta_app.outputs.labels }}
157162

@@ -175,5 +180,6 @@ jobs:
175180
context: .
176181
file: ./Dockerfile.stats
177182
push: true
183+
platforms: linux/amd64,linux/arm64
178184
tags: ${{ steps.meta_stats.outputs.tags }}
179185
labels: ${{ steps.meta_stats.outputs.labels }}

.github/workflows/stage-image.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: MonarcAppFO stage images
2+
3+
on:
4+
push:
5+
branches: [ 'stage' ]
6+
7+
permissions:
8+
contents: read
9+
packages: write
10+
11+
jobs:
12+
publish-stage-images:
13+
if: github.event_name == 'push' && github.ref == 'refs/heads/stage'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Set image names
19+
id: image_names
20+
run: |
21+
owner=$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')
22+
repo=$(echo "${GITHUB_REPOSITORY#*/}" | tr '[:upper:]' '[:lower:]')
23+
echo "app=ghcr.io/${owner}/${repo}" >> "$GITHUB_OUTPUT"
24+
echo "stats=ghcr.io/${owner}/${repo}-stats" >> "$GITHUB_OUTPUT"
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Set up QEMU
30+
uses: docker/setup-qemu-action@v3
31+
32+
- name: Log in to GHCR
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Docker metadata (app)
40+
id: meta_app_stage
41+
uses: docker/metadata-action@v5
42+
with:
43+
images: ${{ steps.image_names.outputs.app }}
44+
tags: |
45+
type=raw,value=stage
46+
type=sha,prefix=stage-
47+
labels: |
48+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
49+
org.opencontainers.image.revision=${{ github.sha }}
50+
51+
- name: Build and push app image (stage)
52+
uses: docker/build-push-action@v6
53+
with:
54+
context: .
55+
file: ./Dockerfile
56+
push: true
57+
platforms: linux/amd64,linux/arm64
58+
tags: ${{ steps.meta_app_stage.outputs.tags }}
59+
labels: ${{ steps.meta_app_stage.outputs.labels }}
60+
61+
- name: Docker metadata (stats)
62+
id: meta_stats_stage
63+
uses: docker/metadata-action@v5
64+
with:
65+
images: ${{ steps.image_names.outputs.stats }}
66+
tags: |
67+
type=raw,value=stage
68+
type=sha,prefix=stage-
69+
labels: |
70+
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
71+
org.opencontainers.image.revision=${{ github.sha }}
72+
73+
- name: Build and push stats image (stage)
74+
uses: docker/build-push-action@v6
75+
with:
76+
context: .
77+
file: ./Dockerfile.stats
78+
push: true
79+
platforms: linux/amd64,linux/arm64
80+
tags: ${{ steps.meta_stats_stage.outputs.tags }}
81+
labels: ${{ steps.meta_stats_stage.outputs.labels }}

0 commit comments

Comments
 (0)