Skip to content

Commit

Permalink
github: Split pages deploy & build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
remko committed Mar 16, 2023
1 parent 988e06f commit b23a34b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build (main)

on:
push:
branches: [main]

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

jobs:
build:
uses: ./.github/workflows/build.yml

deploy-pages:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
19 changes: 2 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ name: Build

on:
push:
branches: ['*', '!main']
workflow_dispatch:
workflow_call:

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

jobs:
build:
strategy:
Expand All @@ -31,6 +26,7 @@ jobs:
if: runner.os == 'macOS'

# Upload build artifacts to site
# Deploy happens in the `deploy-site` workflow, which only runs on main
- run: |
mkdir -p .build/site/ci
cp .build/coverage.svg .build/coverage.html .build/site/ci
Expand All @@ -55,14 +51,3 @@ jobs:
# run: |
# $Env:Path += ";" + (swift build --show-bin-path)
# echo "test" | age --encrypt --recipient age1se1qgg72x2qfk9wg3wh0qg9u0v7l5dkq4jx69fv80p6wdus3ftg6flwg5dz2dp -o secret.txt.age

deploy-pages:
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@v1

0 comments on commit b23a34b

Please sign in to comment.