test-card/Earthfile
Tomáš Mládek 697b8d1f42
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
ci: transfer by checksums
2024-02-03 18:27:15 +01:00

25 lines
750 B
Text

VERSION 0.7
FROM node:lts
site:
RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml /site
WORKDIR /site
CACHE $HOME/.local/share/pnpm
RUN pnpm install --frozen-lockfile
COPY . /site
RUN pnpm build
SAVE ARTIFACT build AS LOCAL build
deploy:
FROM alpine
RUN apk add openssh-client rsync
RUN --secret SSH_CONFIG --secret SSH_UPLOAD_KEY --secret SSH_KNOWN_HOSTS \
mkdir -p $HOME/.ssh && \
echo "$SSH_CONFIG" > $HOME/.ssh/config && \
echo "$SSH_UPLOAD_KEY" > $HOME/.ssh/id_rsa && \
echo "$SSH_KNOWN_HOSTS" > $HOME/.ssh/known_hosts && \
chmod 600 $HOME/.ssh/*
COPY +site/build /build
RUN --secret SSH_TARGET --push rsync -cvrz --delete /build/ $SSH_TARGET