astro/.github/workflows/nightly.yml
Michael Rienstra d7b27a17e3
GitHub Actions: add install action (#5196)
* GitHub Actions: add install action
to reduce duplication

* debug, temp

* expect strings
add warnings

* minor, consistency

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
2022-10-28 12:40:03 -04:00

64 lines
1.8 KiB
YAML

name: 'Nightly'
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 12 * * *'
workflow_dispatch:
jobs:
stat:
if: github.repository_owner == 'withastro'
runs-on: ubuntu-latest
steps:
- name: Check out code using Git
uses: actions/checkout@v3
- name: Install Tools & Dependencies
uses: ./.github/actions/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: Install Tools & Dependencies
uses: ./.github/actions/install
with:
install-dependencies: false
- name: Delete the existing pnpm-lock.yaml file
run: rm pnpm-lock.yaml
- 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@v3
with:
branch: ci/lockfile
# Access token is needed to trigger CI on this PR
token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
commit-message: '[ci] update lockfile'
title: '[ci] update lockfile'
body: >
This PR is auto-generated by a nightly GitHub action.
It should automatically be merged if tests pass.