Skip to content

drinkice-site

drinkice-site #3

Workflow file for this run

name: drinkice-site
on:
workflow_dispatch:
push:
paths:
- 'site/**'
env:
PROJECT_PATH: 'site'
IMAGE_NAME: 'drinkice-site'
jobs:
drinkice-site-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
echo "manager=npm" >> $GITHUB_OUTPUT
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Restore cache
uses: actions/cache@v4
with:
path: |
${{ env.PROJECT_PATH }}/.output
${{ env.PROJECT_PATH }}/.nuxt
key: ${{ runner.os }}-nuxt-build-${{ hashFiles('.output') }}
restore-keys: |
${{ runner.os }}-nuxt-build-
- name: NPM Install
run: npm install
- name: NPM Run Build
run: npm run build
- name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v2
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 'Build and push docker image'
uses: docker/build-push-action@v5
with:
context: ${{ env.PROJECT_PATH }}
file: ${{ env.PROJECT_PATH }}/Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: |
${{ env.IMAGE_NAME }}:latest