generated from 11ty/eleventy-base-blog
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Use actions/deploy-pages to deploy (#419)
* CI: Use `actions/deploy-pages` to deploy * CI: Run `build` job on pull requests too This will attempt to build the site, but deployment only happens from the `main` branch.
- Loading branch information
Showing
1 changed file
with
23 additions
and
8 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 |
---|---|---|
|
@@ -4,11 +4,13 @@ on: | |
push: | ||
branches: [ main ] | ||
|
||
pull_request: | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_deploy: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -30,11 +32,24 @@ jobs: | |
- run: npm run build | ||
- run: echo foundation.rust-lang.org > _site/CNAME | ||
|
||
- name: deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
- uses: actions/[email protected] | ||
with: | ||
publish_dir: _site | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
user_name: 'github-actions[bot]' | ||
user_email: 'github-actions[bot]@users.noreply.github.com' | ||
commit_message: ${{ github.event.head_commit.message }} | ||
path: ./_site | ||
|
||
deploy: | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
|
||
needs: build | ||
|
||
permissions: | ||
pages: write | ||
id-token: write | ||
|
||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- id: deployment | ||
uses: actions/[email protected] |