Skip to content

Commit

Permalink
ci: Add deployment workflow for example
Browse files Browse the repository at this point in the history
  • Loading branch information
jontze committed Jun 10, 2024
1 parent eb8bcf9 commit 5cc2895
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/deploy_example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy Example App

on:
workflow_dispatch:
workflow_call:

env:
MAIN_BRANCH_NAME: 'main'

jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: nrwl/nx-set-shas@v4
with:
main-branch-name: ${{ env.MAIN_BRANCH_NAME }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Deploy
run: npx nx affected -t build
- name: Check if folder exists and set output
id: dist-check
run: echo "exists=$(test -d dist/apps/ng-remote-config-example && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Deploy
if: steps.dist-check.outputs.exists == 'true'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist/apps/ng-remote-config-example
6 changes: 6 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ jobs:
test:
name: Test
uses: ./.github/workflows/test.yaml

deploy:
name: Deploy
needs:
- test
uses: ./.github/workflows/deploy_example.yaml

0 comments on commit 5cc2895

Please sign in to comment.