Skip to content

Merge pull request #18 from Satisfactory-KMods/renovate/all-minor-patch #107

Merge pull request #18 from Satisfactory-KMods/renovate/all-minor-patch

Merge pull request #18 from Satisfactory-KMods/renovate/all-minor-patch #107

Workflow file for this run

name: Build, Push and Deploy
on:
push:
branches:
- '*'
- '!main'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
DOCKERNAME: dev-sfp-wiki
jobs:
prepare-and-build-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: lint and type check
run: |
cp .env.example .env
./installPngs.sh
pnpm add -g bun
pnpm i
bun run lint
rm .env
- name: Log into registry
if: github.event_name != 'pull_request'
uses: docker/login-action@5139682d94efc37792e6b54386b5b470a68a4737
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PAT }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@232fc64e3a4e54539e087c5976439ea54be0959d
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy
uses: appleboy/ssh-action@v1.0.3
with:
timeout: 60m
command_timeout: 60m
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
port: 22
script: |
cd /home/apps/
docker compose up -d --no-deps --pull always --build ${{ env.DOCKERNAME }}
docker image prune --force
sleep 600
docker compose logs ${{ env.DOCKERNAME }}