Skip to content

Commit b3309ec

Browse files
committed
chore(ci): Create continuous integration and deployment piplines
* Publish container images to ghcr.io
1 parent 9027fa8 commit b3309ec

File tree

4 files changed

+49
-1
lines changed

4 files changed

+49
-1
lines changed

.github/workflows/release.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- 'v*.*.*'
10+
11+
jobs:
12+
release-next-container:
13+
uses: radiorabe/actions/.github/workflows/release-container.yaml@v0.37.0
14+
with:
15+
image: 'ghcr.io/radiorabe/website-stack/next'
16+
name: 'next'
17+
display-name: 'RaBe Nextjs Website'
18+
tags: 'rabe web nextjs alpine'
19+
# the alpine base image used for the nextjs frontend does not have a
20+
# keyless cosign signature, so we disable verifying the image.
21+
cosign-verify: false
22+
context: './next/'
23+
dockerfile: './next/Dockerfile.prod'
24+
push-default-branch: true
25+
build-args: |
26+
IMAGES_HOSTNAME=data.rabe.ch

.github/workflows/schedule.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Scheduled tasks
2+
3+
on:
4+
schedule:
5+
- cron: '13 12 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
schedule-trivy:
10+
uses: radiorabe/actions/.github/workflows/schedule-trivy.yaml@v0.30.1
11+
with:
12+
image-ref: 'ghcr.io/radiorabe/website-stack/next:latest'

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Next:
1818

1919
docker-compose up -d next
2020

21-
2221
# Maintenance Mode
2322
In the .env file set NEXT_PUBLIC_MAINTENANCE_MODE true
2423

@@ -27,3 +26,8 @@ Next:
2726
redirect data.rabe.ch auf rabe.ch
2827

2928
disable healthcheck for next instance
29+
30+
# Build Process
31+
32+
The CI/CD setup uses [Docker build-push Action](https://github.com/docker/build-push-action) to publish container images.
33+
The workflow is based on the [RaBe shared actions](https://radiorabe.github.io/actions/).

next/Dockerfile.prod

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ RUN \
2020

2121
# Rebuild the source code only when needed
2222
FROM base AS builder
23+
24+
# defaults for use during the container build phase on CI/CD
25+
ARG IMAGES_PROTOCOL=https
26+
ARG IMAGES_HOSTNAME=**
27+
ARG IMAGES_PORT=433
28+
2329
WORKDIR /app
2430
COPY --from=deps /app/node_modules ./node_modules
2531
COPY . .

0 commit comments

Comments
 (0)