Skip to content

Commit

Permalink
ci: change to deploy app-hub-app on push
Browse files Browse the repository at this point in the history
  • Loading branch information
libotony committed Aug 21, 2023
1 parent 1e0c174 commit ff34b63
Showing 1 changed file with 22 additions and 35 deletions.
57 changes: 22 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
name: Build and Deploy to GH page
name: Build app list and deploy website

on:
push:
branches:
- master
pull_request:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
workflow_dispatch:

jobs:
build:
Expand All @@ -32,30 +20,29 @@ jobs:
node-version: '16'
cache: 'npm'

- name: Setup Pages
uses: actions/configure-pages@v3
if: github.ref == 'refs/heads/master'

- name: Install Dependencies
run: npm ci

- name: Build Website
- name: Build distribution
run: npm run build

- name: Upload artifact
if: github.ref == 'refs/heads/master'
uses: actions/upload-pages-artifact@v1
- name: Checkout apps repo
if: ${{ github.repository_owner == 'vechain' }}
uses: actions/checkout@v3
with:
path: ./dist
deploy:
if: github.ref == 'refs/heads/master'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
repository: 'vechain/app-hub-app'
path: 'website'

- name: Build website
if: ${{ github.repository_owner == 'vechain' }}
run: cd website && npm ci && npm install ../dist && npm run build

- name: Deploy website
if: ${{ github.repository_owner == 'vechain' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.PERSONAL_TOKEN }}
publish_dir: website/dist/
cname: apps.vechain.org
force_orphan: true
external_repository: vechain/app-hub-app

0 comments on commit ff34b63

Please sign in to comment.