Skip to content

Commit

Permalink
[ci] Use pages builds
Browse files Browse the repository at this point in the history
  • Loading branch information
captn3m0 committed Jul 1, 2023
1 parent 380f0f3 commit c1e125d
Showing 1 changed file with 36 additions and 10 deletions.
46 changes: 36 additions & 10 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Based on https://github.com/actions/starter-workflows/blob/main/pages/jekyll.yml
name: publish

on:
push:
branches:
Expand All @@ -10,25 +10,51 @@ on:
# Runs at 12:09 UTC = 17:39 IST
- cron: '09 8,12 * * *'

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
publish:
# Build
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: php generate.php
name: Set current Year
# WIP
# - name: Install curl-impersonate deps
# run: apt-get install --yes libnss3 nss-plugin-pem ca-certificates
# - name: Download libcurl-impersonate
# run: wget "https://github.com/lwthiker/curl-impersonate/releases/download/v0.5.4/libcurl-impersonate-v0.5.4.x86_64-linux-gnu.tar.gz" && \
# tar -xvf libcurl-impersonate-v0.5.4.x86_64-linux-gnu.tar.gz
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true
- name: Generate RSS Feeds
run: bundle exec weneedfeed build --base-url="https://captnemo.in/npci-rss-feeds"
- uses: peaceiris/actions-gh-pages@v3
name: Publish to GitHub Pages
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@64bcae551a7b18bcb9a09042ddf1960979799187 # v1.0.8
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: output
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
force_orphan: true
commit_message: Automatic Update
path: "output/"
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@ee48c7b82e077d7b8ef30b50a719e6a792a50c9a # v2.0.2

0 comments on commit c1e125d

Please sign in to comment.