Build and deploy #14490
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
# Copyright 2023 Google LLC | |
# | |
# Licensed under the Apache License, Version 2.0 (the “License”); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an “AS IS” BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
name: 'Build and deploy' | |
on: | |
schedule: | |
# Run hourly at xx:05. | |
- cron: '05 * * * *' | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-website: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | |
with: | |
ref: ${{ github.head_ref }} | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- name: Set up Node.js | |
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Update last known good versions per channel | |
run: | | |
git config user.name 'Chrome for Testing bot' | |
git config user.email '[email protected]' | |
git add data | |
git commit data -m 'Update latest available version numbers' || true | |
git push | |
- name: Deploy to gh-pages | |
uses: JamesIves/github-pages-deploy-action@ec9c88baef04b842ca6f0a132fd61c762aa6c1b0 # v4.6.0 | |
with: | |
branch: gh-pages | |
folder: dist | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
single-commit: true | |
git-config-name: Chrome for Testing bot | |
git-config-email: [email protected] |