Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build workflow and configure Dependabot
- Loading branch information
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Set update schedule for GitHub Actions | ||
|
||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to GitHub Actions every week | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Generate web page | ||
|
||
on: | ||
push: | ||
branches: 'main' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install modules | ||
run: | | ||
cpanm --installdeps --notest . | ||
- name: Create pages | ||
run: | | ||
perl bin/build | ||
- name: Commit new page | ||
if: github.repository == 'davorg/twittelection' | ||
run: | | ||
GIT_STATUS=$(git status --porcelain) | ||
echo $GIT_STATUS | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
git add docs/ | ||
if [ "$GIT_STATUS" != "" ]; then git commit -m "Automated Web page generation"; fi | ||
if [ "$GIT_STATUS" != "" ]; then git push; fi | ||
- name: Update pages artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: docs/ | ||
|
||
deploy: | ||
needs: build | ||
permissions: | ||
pages: write | ||
id-token: write | ||
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 | ||
|