Unverified Commit 4dfbefff authored by Giuseppe Carboni's avatar Giuseppe Carboni Committed by GitHub
Browse files

Added download of VM for master branch (#917)

parent 273f8af5
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
name: Download the DISCOS VM

on:
  workflow_dispatch:
  repository_dispatch:
    types: [update-vm]

concurrency:
  group: discos
  cancel-in-progress: false

jobs:
  download-vm:
    runs-on: ubuntu-latest
    env:
      REPOSITORY_TOKEN: "${{ secrets.DEPENDENCIES_TOKEN }}"
      GH_TOKEN: "${{ secrets.GH_WORKFLOWS_TOKEN }}"
      GOOGLE_DRIVE_TOKEN: "${{ secrets.GOOGLE_DRIVE_TOKEN }}"
      PROVISIONED_VM_GDRIVE_ID: "${{ secrets.PROVISIONED_VM_GDRIVE_ID }}"
      PROVISIONED_ARCHIVE_GDRIVE_ID: "${{ secrets.PROVISIONED_ARCHIVE_GDRIVE_ID }}"
    steps:
      - name: Clone the deployment repository
        uses: actions/checkout@v4
        with:
          repository: 'discos/deployment'
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3'
          check-latest: true
      - name: Download the provisioned virtual machine from Google Drive
        run: |
          pip install -r .github/utils/gdrive_requirements.txt
          python .github/utils/download_from_gdrive.py
          gh secret set GOOGLE_DRIVE_TOKEN --org discos --visibility selected --repos discos,deployment < token.json
      - name: Save the downloaded VM to cache
        uses: actions/cache/save@v4
        with:
          key: discos-manager-vm
          path: |
            /home/runner/discos_manager.ova
            /home/runner/vagrant.tar.gz