chore: update dependencies (#16) #99
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Semantic release | |
on: | |
push: | |
branches: | |
- main | |
- next | |
- beta | |
- alpha | |
workflow_dispatch: | |
jobs: | |
release_frontend: | |
name: Release frontend | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: frontend | |
steps: | |
- name: Checkout Git repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
package_json_file: frontend/package.json | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
cache-dependency-path: frontend/pnpm-lock.yaml | |
- name: 📦 Install dependencies | |
run: pnpm install | |
- name: ⚒️ Build | |
run: pnpm build | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: pnpm semantic-release | |
release_backend: | |
name: Release backend | |
needs: release_frontend | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: backend | |
steps: | |
- name: Checkout Git repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# needed because backend release would fail if frontend release pushed new changes (e.g. CHANGELOG.md) | |
- name: Pull latest changes from frontend semantic-release | |
run: git pull | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
package_json_file: backend/package.json | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
cache-dependency-path: backend/pnpm-lock.yaml | |
- name: 📦 Install dependencies | |
run: pnpm install | |
- name: 🔎 Lint | |
run: pnpm lint | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: pnpm semantic-release | |
deploy: | |
name: Deploy | |
needs: | |
- release_frontend | |
- release_backend | |
runs-on: ubuntu-latest | |
if: github.ref_name == 'main' | |
steps: | |
- name: Checkout Git repository | |
uses: actions/checkout@v4 | |
- name: Deploy | |
uses: appleboy/ssh-action@v0.1.6 | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
password: ${{ secrets.SSH_PASSWORD }} | |
envs: GITHUB_SERVER_URL,GITHUB_REPOSITORY | |
script: npx nginx-proxy-cli deploy $GITHUB_SERVER_URL/$GITHUB_REPOSITORY --dir=~/nginx-proxy/applications --folder=vorlesungsplan.lars-rickert.de |