diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9fa6c2a33..cc2eb71b4 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -24,6 +24,9 @@ }, "ghcr.io/devcontainers/features/github-cli:1": { "version": "latest" + }, + "ghcr.io/devcontainers/features/sshd:1": { + "version": "latest" } }, diff --git a/.github/workflows/codespaces-ci.sh b/.github/workflows/codespaces-ci.sh new file mode 100755 index 000000000..8484e7a3c --- /dev/null +++ b/.github/workflows/codespaces-ci.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +GITHUB_REPOSITORY="Azure-Samples/contoso-real-estate" +BRANCH="codespaces-ci" +APP_PORT="4280" + +# gh auth login --with-token $GITHUB_TOKEN +gh codespace create \ + --repo $GITHUB_REPOSITORY \ + --branch $BRANCH \ + --retention-period "1h" \ + --display-name "Contoso Real Estate Nightly" \ + --idle-timeout "30m" \ + --machine "largePremiumLinux" \ + --status \ + --default-permissions + +# gh codespace stop -R $GITHUB_REPOSITORY +# gh codespace delete -R $GITHUB_REPOSITORY diff --git a/.github/workflows/codespaces-ci.yml b/.github/workflows/codespaces-ci.yml new file mode 100644 index 000000000..e7450fb63 --- /dev/null +++ b/.github/workflows/codespaces-ci.yml @@ -0,0 +1,21 @@ +name: Nightly Codespace CI + +on: + push: + branches: + - main + schedule: + # Runs every day at 4:00 AM pacific (UTC-7) + - cron: '0 12 * * *' + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Deploy to Codespace + env: + GITHUB_TOKEN: ${{ secrets.CODESPACES_TOKEN }} + run: ./.github/workflows/codespaces-ci.sh \ No newline at end of file