Skip to content

Add version number and link to source code #22

Add version number and link to source code

Add version number and link to source code #22

Workflow file for this run

name: Build & Deploy
on:
push:
branches: ['main']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: bahmutov/npm-install@v1.8.36
- uses: actions/cache@v3.3.2
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Set environment variables for version tracking
run: |
echo "NEXT_PUBLIC_APP_VERSION_LABEL=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
echo "NEXT_PUBLIC_VERSION_URL=https://github.com/mhoff/meshup/commit/${{ github.sha }}" >> $GITHUB_ENV
- name: Build
run: npm run build
- name: Deploy
uses: up9cloud/action-rsync@v1.4
env:
HOST: w01d1f1b.kasserver.com
USER: ssh-w01d1f1b
KEY: ${{secrets.DEPLOY_SSH_KEY}}
ARGS: -ar --delete
SOURCE: out/
TARGET: /www/htdocs/w01d1f1b/meshup.mhoff.net