Release 4.2.0 #321
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: Preview Workflow | |
on: | |
pull_request: | |
type: | |
- opened | |
- synchronize | |
- reopened | |
- closed | |
env: | |
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} | |
PREVIEW_DOMAIN: https://msg-adamant-pr-${{ github.event.number }}.surge.sh | |
jobs: | |
build-and-deploy-to-surge: | |
name: Build and Deploy to surge | |
runs-on: ubuntu-latest | |
environment: testing | |
permissions: | |
pull-requests: write | |
steps: | |
- name: Checkout repository 🛎️ | |
uses: actions/checkout@v3 | |
- name: Setup Node version 🍀 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install dependencies ⚙️ | |
run: npm ci | |
- name: Build PWA 🛠️ | |
run: | | |
npm run schema:generate | |
npm run build | |
- name: Archive artifacts 📁 | |
uses: actions/upload-artifact@v3 | |
with: | |
path: dist | |
- name: Deploy to surge 🚀 | |
run: | | |
npm install --global surge | |
surge ./dist ${{ env.PREVIEW_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }} | |
- name: Comment PR 💬 | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
message: | | |
Deployed to ${{ env.PREVIEW_DOMAIN }} 🚀 | |
comment_tag: deploy-message |