name: Update Staging

on:
  workflow_dispatch:
  schedule:
    - cron: '00 10 * * *'   # time in UTC

jobs:
  copy-main-to-staging:
    runs-on: ubuntu-latest
    steps:
      - name: Login to GitHub Container Registry
        uses: docker/login-action@v2
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Setup crane
        uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c

      - name: Copy Main to Staging
        run: |
          crane tag ghcr.io/acorn-io/acorn:main stg
