-
Notifications
You must be signed in to change notification settings - Fork 83
93 lines (79 loc) · 2.4 KB
/
upload.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Deploy PWA
on:
# release:
# types: [published]
# push:
# branches: [main]
workflow_dispatch:
inputs:
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@v3
with:
ref: ${{ inputs.tag-version }}
- name: Enable corepack
run: corepack enable
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '20.5'
cache: 'yarn'
registry-url: 'https://npm.pkg.github.com'
- name: Set yarn version
run: |
yarn set version stable
yarn set version 3.6.4
- name: Setup .yarnrc.yml
run: |
yarn config set nodeLinker node-modules
yarn config set npmScopes.plentymarkets.npmRegistryServer "https://npm.pkg.github.com"
yarn config set npmScopes.plentymarkets.npmAlwaysAuth true
yarn config set npmScopes.plentymarkets.npmAuthToken $NODE_AUTH_TOKEN
yarn plugin import workspace-tools
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Dependencies
run: yarn --frozen-lockfile
- 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 File
id: upload
uses: JantHsueh/[email protected]
with:
url: 'https://pwapublish.plentysystems.com'
forms: '{ "token": "${{ secrets.URL_ENDPOINT_TOKEN }}" }'
fileForms: '{ "file": "pwa.tar.gz" }'