Skip to content

Alpaca Investor maintenance #90

Alpaca Investor maintenance

Alpaca Investor maintenance #90

name: Alpaca Investor maintenance
on:
workflow_dispatch:
schedule:
# Run every weekday at 4 PM EST
- cron: "0 20 * * 1-5"
jobs:
build:
name: E2E maintenance
runs-on: ubuntu-latest-m
steps:
- uses: actions/checkout@v3
- name: Configure 1Password Service Account
uses: 1password/load-secrets-action/configure@v1
with:
service-account-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
- name: Load secrets
uses: 1password/load-secrets-action@v1
with:
export-env: true
env:
BELAYALPACA__ALPACA__KEY: op://DevOps/.env.belay-api/all/export BELAYALPACA__ALPACA__KEY
BELAYALPACA__ALPACA__SECRET: op://DevOps/.env.belay-api/all/export BELAYALPACA__ALPACA__SECRET
- name: Determine the elixir version
run: echo "ELIXIR_VERSION=$(grep -h elixir .tool-versions | awk '{ print $2 }' | awk -F - '{print $1}')" >> $GITHUB_ENV
- name: Determine the otp version
run: echo "OTP_VERSION=$(grep -h erlang .tool-versions | awk '{ print $2 }')" >> $GITHUB_ENV
- name: Setup Elixir and Erlang versions
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
- name: Cache Mix
uses: actions/cache@v3
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-${{ hashFiles('**/mix.lock') }}-2023-09-29
- name: Install mix dependencies
run: mix deps.get
- name: Run E2E maintenance task
run: mix alpaca_investor.maintenance ${{vars.BELAYALPACA__ALPACA_BELAY_ACCOUNT_ID}}