Skip to content

Commit

Permalink
fix(publish-site.yml): avoid unnecessary setup if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
gouravkhunger committed Jun 29, 2023
1 parent 65721ad commit 3ccfed7
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/publish-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,26 @@ jobs:
with:
fetch-depth: 1

- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
files:
- '_data/**'
- '_posts/**'
- '_drafts/**'
- '_series/**'
- name: Checkout theme-files repo
if: steps.changes.outputs.files == 'true' || github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
with:
repository: genicsblog/theme-files
path: theme
fetch-depth: 1

- name: Setup theme and necessary files
if: steps.changes.outputs.files == 'true' || github.event_name == 'workflow_dispatch'
run: |
mv theme/* .
rm -rf theme
Expand All @@ -35,25 +47,14 @@ jobs:
echo "AWG.LA, 22950318798, DIRECT" >> ads.txt
echo "google.com, pub-9130183266015225, RESELLER, f08c47fec0942fa0" >> ads.txt
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
files:
- '_data/**'
- '_drafts/**'
- '_pages/**'
- '_posts/**'
- '_series/**'
- '_tools/**'
- '_config.yml'
- uses: ruby/setup-ruby@v1
if: steps.changes.outputs.files == 'true' || github.event_name == 'workflow_dispatch'
with:
ruby-version: 2.7.5
bundler-cache: true

- uses: actions/setup-node@v2
if: steps.changes.outputs.files == 'true' || github.event_name == 'workflow_dispatch'
with:
node-version: '16'

Expand All @@ -62,7 +63,7 @@ jobs:
run: npm install

- name: Restore/cache .jekyll-cache folder
if: github.event_name == 'push' || github.event.inputs.cache == 'false'
if: steps.changes.outputs.files == 'true' || github.event.inputs.cache == 'false'
id: jekyll-cache
uses: actions/cache@v3
with:
Expand Down

1 comment on commit 3ccfed7

@vercel
Copy link

@vercel vercel bot commented on 3ccfed7 Jun 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

genicsblog – ./

genicsblog-genics.vercel.app
genicsblog-git-main-genics.vercel.app
genicsblog.vercel.app

Please sign in to comment.