astro/.github/workflows/nightly.yml
2023-05-16 09:35:06 -04:00

82 lines
2.2 KiB
YAML

name: "Nightly"
on:
schedule:
# Run every Monday at 12:00 UTC
- cron: "0 12 * * 1"
workflow_dispatch:
jobs:
stat:
# Temporarily disable since stat collection hasn't work for a while
if: false
runs-on: ubuntu-latest
steps:
- name: Check out code using Git
uses: actions/checkout@v3
- name: Setup PNPM
uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Collect stats
run: node scripts/stats/index.js
env:
# Needs access to collect stats from the GitHub API
GITHUB_TOKEN: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "[ci] collect stats"
branch: ${{ github.head_ref }}
# Needs access to push to main
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
lockfile:
if: github.repository_owner == 'withastro'
runs-on: ubuntu-latest
steps:
- name: Check out code using Git
uses: actions/checkout@v3
- name: Setup PNPM
uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: "pnpm"
- name: Delete the existing pnpm-lock.yaml file
run: rm pnpm-lock.yaml
# https://github.com/pnpm/pnpm/issues/6463
- name: Update .npmrc to update packages to latest
run: echo "resolution-mode=highest" >> .npmrc
- name: Create a fresh pnpm lockfile (no install)
run: pnpm install --lockfile-only
- name: Create Pull Request
id: createpr
uses: peter-evans/create-pull-request@v5
with:
branch: ci/lockfile
# Access token is needed to trigger CI on this PR
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
commit-message: "[ci] update lockfile"
add-paths: pnpm-lock.yaml
title: "[ci] update lockfile"
body: >
This PR is auto-generated by a nightly GitHub action.
It should automatically be merged if tests pass.