Update GitHub Runners #143
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: Update GitHub Runners | |
on: | |
schedule: | |
- cron: "0 1 * * *" | |
jobs: | |
push_image: | |
name: Update docker GitHub action runner image | |
runs-on: home-automation | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Docker system prune | |
run: docker system prune -f | |
- name: Extract node version from package.json | |
uses: sergeysova/jq-action@v2 | |
id: node_version | |
with: | |
cmd: jq .engines.node package.json -r | sed -e 's/"//g' | sed -e 's/>=//g' | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "${{ steps.node_version.outputs.value }}" | |
- name: Use Yarn | |
run: corepack enable | |
- name: Install deps | |
run: yarn | |
- name: Prepare | |
run: yarn nx run-many --target=prepare --all | |
env: | |
ONEPASSWORD_TOKEN: ${{ secrets.ONEPASSWORD_TOKEN }} | |
ONEPASSWORD_SERVER_URL: ${{ secrets.ONEPASSWORD_SERVER_URL }} | |
ONEPASSWORD_VAULT_ID: ${{ secrets.ONEPASSWORD_VAULT_ID }} | |
- name: Build/push docker image | |
run: yarn run image/push github-action-runners | |
env: | |
ONEPASSWORD_TOKEN: ${{ secrets.ONEPASSWORD_TOKEN }} | |
ONEPASSWORD_SERVER_URL: ${{ secrets.ONEPASSWORD_SERVER_URL }} | |
ONEPASSWORD_VAULT_ID: ${{ secrets.ONEPASSWORD_VAULT_ID }} |