Skip to content

Commit 6394575

Browse files
committed
wip: add actions for build and push
1 parent 38e2b7b commit 6394575

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ max_line_length = 100
1212
[*.md]
1313
max_line_length = off
1414
trim_trailing_whitespace = false
15+
16+
[*.yaml]
17+
indent_size = 2
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Docker Create Image
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
jobs:
8+
build-and-push:
9+
name: Build and push Docker image
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out the repository
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 20
19+
20+
- name: Cache .pnpm-store
21+
uses: actions/cache@v3
22+
with:
23+
path: ~/.pnpm-store
24+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
25+
restore-keys: |
26+
${{ runner.os }}-pnpm-
27+
28+
- name: Install Dependencies
29+
run: pnpm install
30+
31+
- name: Build
32+
run: pnpm build
33+
34+
- name: Log in to Docker Hub
35+
uses: docker/login-action@v3
36+
with:
37+
username: ${{ secrets.DOCKER_USERNAME }}
38+
password: ${{ secrets.DOCKER_PASSWORD }}
39+
40+
- name: Extract metadata (tags, labels) for Docker
41+
id: meta
42+
uses: docker/metadata-action@v5
43+
with:
44+
images: rherwig/hrwg-website
45+
46+
- name: Build and push Docker image
47+
uses: docker/build-push-action@v5
48+
with:
49+
context: .
50+
file: ./apps/website/Dockerfile
51+
push: true
52+
tags: ${{ steps.meta.outputs.tags }}
53+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)