Skip to content

move <NuxtLayout> to prevent warning #61

move <NuxtLayout> to prevent warning

move <NuxtLayout> to prevent warning #61

Workflow file for this run

name: Push Nuxt App to Docker
on:
push:
branches:
- master
workflow_dispatch:
permissions:
contents: read
packages: write
actions: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest
type=sha,prefix=
- name: Check for existing cache
id: cache-check
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile', '**/package*.json') }}
- name: Delete old caches if no cache found
if: steps.cache-check.outputs.cache-hit != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if gh cache list --repo ${{ github.repository }} | grep -q 'buildx'; then
gh cache delete --all --repo ${{ github.repository }}
else
echo "No caches to delete."
fi
- name: Delete old package versions
uses: actions/delete-package-versions@v5
with:
# Name of the package.
# Required
package-name: ${{ github.event.repository.name }}
# Type of the package. Can be one of docker (v4 or older), container (v5 or newer), maven, npm, nuget, or rubygems.
# Required
package-type: container
# The number of latest versions to keep.
# This cannot be specified with `num-old-versions-to-delete`. By default, `min-versions-to-keep` takes precedence over `num-old-versions-to-delete`.
# When set to 0, all deletable versions will be deleted.
# When set greater than 0, all deletable package versions except the specified number will be deleted.
min-versions-to-keep: 3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile', '**/package*.json') }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
# Temp fix for growing cache size
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache