Skip to content

Commit

Permalink
wip: add actions for build and push
Browse files Browse the repository at this point in the history
  • Loading branch information
rherwig committed Nov 7, 2023
1 parent 38e2b7b commit 6394575
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ max_line_length = 100
[*.md]
max_line_length = off
trim_trailing_whitespace = false

[*.yaml]
indent_size = 2
53 changes: 53 additions & 0 deletions .github/workflows/docker-create-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Docker Create Image

on:
release:
types: [ published ]

jobs:
build-and-push:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20

- name: Cache .pnpm-store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: pnpm install

- name: Build
run: pnpm build

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: rherwig/hrwg-website

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./apps/website/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 6394575

Please sign in to comment.