forked from alshedivat/al-folio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed conditions of running GitHub actions (alshedivat#2082)
The GitHub actions were running everytime a new commit was made to the repo, but that wasn't needed. For example, we don't need to try to create a new docker image if the libraries didn't change, same to build the whole site after a change in the README.md. --------- Signed-off-by: George Araújo <[email protected]>
- Loading branch information
1 parent
eb13238
commit 3271fb3
Showing
11 changed files
with
109 additions
and
54 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
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 |
---|---|---|
@@ -1,33 +1,29 @@ | ||
name: Check for broken links on site | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
workflow_dispatch: | ||
workflow_run: | ||
workflows: [Deploy site] | ||
types: [completed] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
check-links-on-site: | ||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
# available images: https://github.com/actions/runner-images#available-images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.2.2" | ||
ruby-version: "3.3" | ||
bundler-cache: true | ||
- name: Update _config.yml ⚙️ | ||
uses: fjogeleit/yaml-update-action@v0.13.1 | ||
uses: fjogeleit/yaml-update-action@main | ||
with: | ||
commitChange: false | ||
valueFile: "_config.yml" | ||
|
@@ -40,9 +36,11 @@ jobs: | |
run: | | ||
pip3 install --upgrade jupyter | ||
npm install -g mermaid.cli | ||
npm install -g purgecss | ||
export JEKYLL_ENV=production | ||
bundle exec jekyll build --lsi | ||
- name: Purge unused CSS 🧹 | ||
run: | | ||
npm install -g purgecss | ||
purgecss -c purgecss.config.js | ||
- name: Link Checker 🔗 | ||
uses: lycheeverse/[email protected] | ||
|
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 |
---|---|---|
|
@@ -2,13 +2,43 @@ name: Check for broken links | |
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
paths: | ||
- "assets/**" | ||
- "**.html" | ||
- "**.js" | ||
- "**.liquid" | ||
- "**/*.md" | ||
- "**.yml" | ||
- "!.github/workflows/axe.yml" | ||
- "!.github/workflows/deploy-docker-tag.yml" | ||
- "!.github/workflows/deploy-image.yml" | ||
- "!.github/workflows/docker-slim.yml" | ||
- "!.github/workflows/prettier.yml" | ||
pull_request: | ||
branches: | ||
- master | ||
- main | ||
paths: | ||
- "assets/**" | ||
- "**.html" | ||
- "**.js" | ||
- "**.liquid" | ||
- "**/*.md" | ||
- "**.yml" | ||
- "!.github/workflows/axe.yml" | ||
- "!.github/workflows/deploy-docker-tag.yml" | ||
- "!.github/workflows/deploy-image.yml" | ||
- "!.github/workflows/docker-slim.yml" | ||
- "!.github/workflows/prettier.yml" | ||
|
||
jobs: | ||
link-checker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Link Checker 🔗 | ||
uses: lycheeverse/[email protected] | ||
|
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
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
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
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 |
---|---|---|
|
@@ -14,27 +14,27 @@ on: | |
|
||
jobs: | ||
build: | ||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} and github.repository_owner == 'alshedivat' | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'alshedivat' | ||
|
||
defaults: | ||
run: | ||
working-directory: ${{ github.workspace }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login | ||
uses: docker/login-action@v2 | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: update docker-compose | ||
shell: bash | ||
run: | | ||
sed -i "s|\.:|${{ github.workspace }}:|g" ${{ github.workspace }}/docker-compose.yml | ||
sed -i "s|\.:|${{ github.workspace }}:|g" ${{ github.workspace }}/docker-compose.yml | ||
cat ${{ github.workspace }}/docker-compose.yml | ||
- uses: kitabisa/[email protected] | ||
|
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
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
content: ["_site/**/*.html", "_site/**/*.js"], | ||
content: ["_site/**.html", "_site/**.js"], | ||
css: ["_site/assets/css/*.css"], | ||
output: "_site/assets/css/", | ||
skippedContentGlobs: ["_site/assets/**/*.html"], | ||
skippedContentGlobs: ["_site/assets/**.html"], | ||
}; |