This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
Schedule update check #8
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: Schedule update check | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
defaults: | |
run: | |
shell: bash | |
env: | |
TZ: "/usr/share/zoneinfo/America/Los_Angeles" | |
TERM: dumb | |
ADMIN_EMAIL: ${{ secrets.ADMIN_EMAIL }} | |
ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }} | |
ADMIN_USERNAME: ${{ secrets.ADMIN_USERNAME }} | |
# Needed because the default token is not supported to push. | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
TERMINUS_TOKEN: ${{ secrets.TERMINUS_TOKEN }} | |
TEST_SITE_NAME: ${{ secrets.TERMINUS_SITE }} | |
CI_BRANCH: ${{ github.ref }} | |
COMMIT_SHA: ${{ github.sha }} | |
CI_BUILD_NUMBER: ${{ github.run_number }} | |
DEFAULT_SITE: ${{ secrets.TERMINUS_SITE }} | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
GITHUB_OWNER: ${{ github.repository_owner }} | |
CI_PROJECT_NAME: ${{ github.repository }} | |
jobs: | |
scheduled_update_check: | |
container: | |
image: quay.io/pantheon-public/build-tools-ci:8.x-php8.1 | |
options: --user root | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set bash_env env var | |
run: echo BASH_ENV=${RUNNER_TEMP}/bash_env.txt >> $GITHUB_ENV | |
- name: Cache bash_env.txt | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-bash-env | |
with: | |
path: ${{ env.BASH_ENV }} | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.run_number }} | |
# Set TERMINUS_ENV and related environment variables. | |
# https://github.com/pantheon-systems/docker-build-tools-ci/blob/6.x/scripts/set-environment | |
- name: setup-environment-vars | |
run: | | |
/build-tools-ci/scripts/set-environment | |
- name: Authenticate with Terminus | |
run: terminus -n auth:login --machine-token="$TERMINUS_TOKEN" | |
- name: run composer lock updater | |
run: | | |
echo "$SSH_PRIVATE_KEY" > ../private.key | |
chmod 600 ../private.key | |
eval `ssh-agent -s` | |
ssh-add ../private.key | |
source $BASH_ENV | |
set -e && terminus project:clu $TERMINUS_SITE |