Update snyk/actions digest to e222141 #446
This file contains hidden or 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: Build and Deploy to Cloudflare Pages | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: read | |
id-token: write | |
deployments: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@09d2acae674a48949e3602304ab46fd20ae0c42f | |
- name: Setup Ruby | |
id: setup-ruby | |
uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 | |
with: | |
ruby-version: '3.4.2' | |
bundler-cache: true | |
- name: Install dependencies | |
if: steps.setup-ruby.outputs.cache-hit != 'true' | |
run: | | |
gem install bundler | |
bundle install --jobs 4 --retry 3 | |
working-directory: ./site | |
- name: Install Node.js | |
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
with: | |
node-version: 22.16.0 | |
- name: Cache npm global packages | |
id: cache-npm-global | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-npm-global-${{ hashFiles('**/package-lock.json') || github.sha }} | |
restore-keys: | | |
${{ runner.os }}-npm-global- | |
- name: Debug cache outputs | |
run: echo "Cache hit is ${{ steps.cache-npm-global.outputs.cache-hit }}" | |
- name: Install Wrangler | |
if: steps.cache-npm-global.outputs.cache-hit != 'true' | |
run: npm install -g wrangler | |
- name: Build site | |
run: | | |
bundle exec jekyll build --source $GITHUB_WORKSPACE --destination $GITHUB_WORKSPACE/site/build --config $GITHUB_WORKSPACE/site/_config.yml --verbose | |
working-directory: ./site | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@de65e23aa2b7e23d713bb51fbfcb6d502f8667d8 | |
with: | |
name: site-build | |
path: site/build | |
if-no-files-found: error | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' | |
steps: | |
- name: Download build artifacts | |
uses: actions/download-artifact@448e3f862ab3ef47aa50ff917776823c9946035b | |
with: | |
name: site-build | |
path: site/build | |
- name: Install Node.js | |
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | |
with: | |
node-version: 22.16.0 | |
- name: Cache npm global packages | |
id: cache-npm-global | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-npm-global-${{ hashFiles('**/package-lock.json') || github.sha }} | |
restore-keys: | | |
${{ runner.os }}-npm-global- | |
- name: Install Wrangler | |
if: steps.cache-npm-global.outputs.cache-hit != 'true' | |
run: npm install -g wrangler | |
- name: Publish | |
uses: cloudflare/[email protected] | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
command: pages deploy site/build --project-name=postquantum-feldman-vss |