Skip to content

break: switch to pnpm #103

break: switch to pnpm

break: switch to pnpm #103

Workflow file for this run

name: Build and Publish the Docker Image
on:
push:
branches:
- main
env:
GITHUB_SHA: ${{ github.sha }}
IMAGE: ssr
REGISTRY_HOSTNAME: ghcr.io
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [20]
steps:
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Checkout
uses: actions/checkout@v4
- name: Cache node_modules
uses: actions/cache@v3
id: cached-node_modules
with:
path: |
node_modules
key: ${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install Dependencies
if: steps.cached-node_modules.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
- name: Build Nuxt App
run: pnpm build
- name: Build Docker Image
run: |
docker build \
-t "$REGISTRY_HOSTNAME"/cytoid/"$IMAGE" \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" .
- name: Save Docker Image
run: |
docker save "$REGISTRY_HOSTNAME"/cytoid/"$IMAGE" | gzip > image.tar.gz
- name: Upload Docker Image
uses: actions/upload-artifact@v2
with:
name: docker-image
path: image.tar.gz
- name: Publish Docker Image
run: |
docker push "$REGISTRY_HOSTNAME"/cytoid/"$IMAGE"
- name: Publish
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: cytoid
directory: ./.output/public
gitHubToken: ${{ secrets.GITHUB_TOKEN }}