📦 Daily update: 2025-02-27 #6
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
name: Deploy Jekyll with GitHub Pages dependencies preinstalled | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["main"] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# 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: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Stop if running in a fork | |
run: | | |
if [[ "${{ github.repository }}" != "ff137/bitstamp-btcusd-minute-data" ]]; then | |
echo "This workflow is disabled for forks." | |
exit 0 | |
fi | |
- name: Stop if the commit is from GitHub Actions Bot | |
run: | | |
AUTHOR=$(git log -1 --pretty=format:'%an') | |
if [[ "$AUTHOR" == "github-actions[bot]" ]]; then | |
echo "Skipping deployment because the commit was made by GitHub Actions." | |
exit 0 | |
fi | |
- name: Setup GitHub Pages | |
uses: actions/configure-pages@v5 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: ./ | |
destination: ./_site | |
- name: Inject Google Site Verification Meta Tag | |
run: | | |
META_TAG='<meta name="google-site-verification" content="${{ secrets.GOOGLE_VERIFICATION_CODE }}" />' | |
find ./_site -name "*.html" -exec sudo sed -i "s|</head>|$META_TAG\n</head>|g" {} + | |
- name: Modify Header Link in Built HTML | |
run: | | |
find ./_site -type f -name "*.html" -exec sudo sed -i 's|<h1><a href="https://ff137.github.io/bitstamp-btcusd-minute-data/"|<h1><a href="https://github.com/ff137/bitstamp-btcusd-minute-data/"|g' {} + | |
- name: Upload Artifact for Deployment | |
uses: actions/upload-pages-artifact@v3 | |
# 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@v4 |