chore: address display styling (#871) #214
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: Deploy PWA | |
on: | |
release: | |
types: [published] | |
push: | |
branches: [main] | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: 'The environment to deploy to' | |
type: choice | |
required: true | |
default: 'staging' | |
options: | |
- staging | |
- production | |
tag-version: | |
description: 'The tag version, branch name or SHA to checkout' | |
required: true | |
permissions: | |
contents: read | |
packages: read | |
jobs: | |
build-and-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.tag-version || github.ref }} | |
- name: Setup Node and Yarn | |
uses: ./.github/actions/setup | |
with: | |
npm-auth-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup environment | |
run: | | |
touch apps/web/.env | |
cat <<EOT >> apps/web/.env | |
API_URL=${{ vars.API_URL }} | |
API_SECURITY_TOKEN=${{ secrets.API_SECURITY_TOKEN }} | |
${{ vars.CONFIG }} | |
EOT | |
- name: Build | |
run: yarn build | |
- name: Install productive dependencies for server | |
run: yarn workspaces focus --production | |
- name: Copy Middleware Server | |
run: | | |
mkdir middleware | |
cp -r node_modules middleware | |
cp -r apps/server middleware | |
- name: Compress repo to Tar | |
uses: a7ul/[email protected] | |
id: compress | |
with: | |
command: c | |
cwd: ./ | |
files: | | |
./apps/web/.output | |
./middleware | |
outPath: pwa.tar.gz | |
- name: Upload build to production | |
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'production') | |
id: upload-production | |
uses: JantHsueh/[email protected] | |
with: | |
url: 'https://pwapublish.plentysystems.com' | |
forms: '{ "token": "${{ secrets.URL_ENDPOINT_TOKEN }}" }' | |
fileForms: '{ "file": "pwa.tar.gz" }' | |
- name: Upload build to staging | |
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'staging') | |
id: upload-staging | |
uses: JantHsueh/[email protected] | |
with: | |
url: 'https://pwapublish.plentysystems.com' | |
forms: '{ "token": "${{ secrets.URL_ENDPOINT_TOKEN_STAGING }}" }' | |
fileForms: '{ "file": "pwa.tar.gz" }' |