Skip to content

Commit

Permalink
DOPS-445 Updated the GitHub workflows related to WebApp (#700)
Browse files Browse the repository at this point in the history
* `webapp-deploy.yml` updated 
* `webapp-push.yml` renamed to `webapp-test.yml` and updated
* added `aragon/apps/.github/fleek/production.json`
  • Loading branch information
chilcano authored Feb 13, 2023
1 parent 77691cb commit e6b3b4b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
File renamed without changes.
16 changes: 10 additions & 6 deletions .github/workflows/pull_request_webapp_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
run:
working-directory: packages/web-app
steps:
- name: Find Previous Deployment
- name: Find a PR comment
uses: peter-evans/find-comment@v2
id: fc
with:
Expand All @@ -31,8 +31,9 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
})
- uses: actions/checkout@v3
- name: Install node
- name: Checkout code
uses: actions/checkout@v3
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
Expand All @@ -47,6 +48,8 @@ jobs:
run: yarn install --pure-lockfile
- name: Link ui-components
run: yarn link @aragon/ui-components
# - name: Lint
# run: yarn lint
- name: Build
run: yarn build
env:
Expand All @@ -56,11 +59,12 @@ jobs:
VITE_IPFS_API_KEY: ${{secrets.VITE_IPFS_API_KEY}}
VITE_ETHERSCAN_API_KEY: ${{secrets.VITE_ETHERSCAN_API_KEY}}
NODE_OPTIONS: '--max-old-space-size=6656'
- uses: actions/setup-python@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
architecture: 'x64'
- name: install pyyaml
- name: Install Python modules
run: |
pip install --user pyyaml packaging
- name: Install ipfs-cluster-ctl
Expand All @@ -81,7 +85,7 @@ jobs:
ipfsResult="$(./ipfs-cluster-ctl/ipfs-cluster-ctl --basic-auth '${{ secrets.IPFS_BASIC_AUTH }}' --host '${{ secrets.IPFS_HOST }}' add -r './dist/' | tail -1)"
IFS=" " read -ra array <<< "$ipfsResult"
echo "ipfsHash=${array[1]}" >> $GITHUB_OUTPUT
- name: Echo url
- name: Update the PR comment
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/webapp-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ jobs:
if: endsWith(github.ref, '/main')
id: envprod
run: echo "environment=production" >> $GITHUB_OUTPUT
build-deploy:

build-and-deploy:
runs-on: ubuntu-latest
container: fleek/create-react-app:node-16
needs: [set-environment]
Expand All @@ -35,8 +36,9 @@ jobs:
run:
working-directory: ${{env.working-directory}}
steps:
- uses: actions/checkout@v3
- name: Install node
- name: Checkout code
uses: actions/checkout@v3
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
Expand All @@ -51,6 +53,8 @@ jobs:
run: yarn install --pure-lockfile
- name: Link ui-components
run: yarn link @aragon/ui-components
# - name: Lint
# run: yarn lint
- name: Test
run: yarn test
- name: Build
Expand All @@ -62,19 +66,19 @@ jobs:
VITE_IPFS_API_KEY: ${{secrets.VITE_IPFS_API_KEY}}
VITE_ETHERSCAN_API_KEY: ${{secrets.VITE_ETHERSCAN_API_KEY}}
NODE_OPTIONS: '--max-old-space-size=6656'
- name: Activate fleek
- name: Activate Fleek
env:
FLEEK_FILE: ${{ needs.set-environment.outputs.environment }}
run: mv ../../.github/fleek/$FLEEK_FILE.json .fleek.json
- name: Deploy fleek
- name: Deploy through Fleek
id: deploy
uses: fleekhq/action-deploy@v1
with:
apiKey: ${{ secrets.FLEEK_API_KEY }}
workDir: ${{ env.working-directory }}
- name: Get the output url
run: echo "Deploy url is ${{ steps.deploy.outputs.deployUrl }}"
- name: upload sourcemap to apm
- name: Get the Fleek output url
run: echo "The Fleek deploy url is ${{ steps.deploy.outputs.deployUrl }}"
- name: Upload sourcemap to Kibana sourcemap endpoint (APM)
env:
COMMIT_SHA: ${{ github.sha }}
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
name: WebApp Push
name: WebApp Test
on:
workflow_dispatch:
push:
paths:
- 'packages/web-app/**'
branches-ignore: ## Ignore develop and main branches to avoid an unneeded 2nd build.
- 'develop'
- 'main'

env:
working-directory: packages/web-app

jobs:
test:
build-and-test:
runs-on: ubuntu-latest
container: fleek/create-react-app:node-16
defaults:
run:
working-directory: ${{env.working-directory}}
steps:
- uses: actions/checkout@v3
- name: Install node
- name: Checkout code
uses: actions/checkout@v3
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 16
Expand Down

0 comments on commit e6b3b4b

Please sign in to comment.