Skip to content

Build and Deploy

Build and Deploy #28

name: Build and Deploy
concurrency: ci-${{ github.ref }}
on:
push:
branches: [main]
paths:
- "**"
- "!**.md"
workflow_dispatch:
repository_dispatch:
types: [build-and-deploy]
jobs:
dispatch-wordy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Dispatch Wordy
uses: peter-evans/repository-dispatch@v2
with:
repository: nsmaciej/wordy
event-type: build-and-deploy
# Check out https://github.com/peter-evans/repository-dispatch#token
token: ${{ secrets.WORDY_ACCESS_TOKEN }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Install and Build
run: |
npm ci
npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "build"
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4