Skip to content

Commit

Permalink
Publish to GitHub Pages as part of merge workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinlul committed Mar 9, 2024
1 parent 4a030bb commit 20462a2
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: © 2022–2023 Kevin Lu
# SPDX-FileCopyrightText: © 2022–2024 Kevin Lu
# SPDX-Licence-Identifier: AGPL-3.0-or-later
name: Merge all data sources

Expand Down Expand Up @@ -100,6 +100,12 @@ jobs:
run: |
sed -s '1i---' data/cards/*.yaml > ../aggregate/cards.yaml
sed -s '1i---' data/rush/*.yaml > ../aggregate/rush.yaml
- if: steps.commit.outputs.status > 0
run: cp aggregate/* yaml-yugi/data
- if: steps.commit.outputs.status > 0
uses: actions/upload-pages-artifact@v3
with:
path: yaml-yugi/data
- if: steps.commit.outputs.status > 0
working-directory: aggregate
name: Commit aggregate
Expand Down Expand Up @@ -127,3 +133,17 @@ jobs:
run: |
yarn ts-node src/load.ts ../aggregate/cards.yaml yu-gi-oh_ocg-tcg
yarn ts-node src/load.ts ../aggregate/rush.yaml yu-gi-oh_rush
deploy-pages:
needs: merge
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/deploy-pages@v4
id: deployment

0 comments on commit 20462a2

Please sign in to comment.