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 abb3962
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 334 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
62 changes: 62 additions & 0 deletions .github/workflows/docker-create-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Docker Create Image

on:
push:
branches:
- 'main'
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

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- 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 }}
2 changes: 0 additions & 2 deletions apps/website/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { qwikCity } from '@builder.io/qwik-city/vite';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import { qwikNxVite } from 'qwik-nx/plugins';
import UnoCSS from 'unocss/vite';

export default defineConfig({
cacheDir: '../../node_modules/.vite/apps/website',
Expand All @@ -20,7 +19,6 @@ export default defineConfig({
tsconfigFileNames: ['tsconfig.app.json'],
}),
tsconfigPaths({ root: '../../' }),
// UnoCSS(),
],
server: {
fs: {
Expand Down
Loading

0 comments on commit abb3962

Please sign in to comment.