Skip to content

Commit

Permalink
ci: add nightly codespace CI
Browse files Browse the repository at this point in the history
  • Loading branch information
manekinekko committed Mar 14, 2024
1 parent d4437a7 commit e26c0b6
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Expand Up @@ -24,6 +24,9 @@
},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
}
},

Expand Down
19 changes: 19 additions & 0 deletions .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
21 changes: 21 additions & 0 deletions .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

0 comments on commit e26c0b6

Please sign in to comment.