diff --git a/.github/workflows/example-get-started-deploy.yaml b/.github/workflows/example-get-started-deploy.yaml new file mode 100644 index 0000000..134c5e4 --- /dev/null +++ b/.github/workflows/example-get-started-deploy.yaml @@ -0,0 +1,59 @@ +name: example-get-started deploy +on: + push: + paths: + - example-get-started/** + branches: + - master + workflow_dispatch: +permissions: write-all +jobs: + test: + runs-on: ubuntu-latest + environment: aws + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + cache: 'pip' + - uses: aws-actions/configure-aws-credentials@v2 + with: + aws-region: us-east-2 + role-to-assume: ${{ vars.AWS_SANDBOX_ROLE }} + role-duration-seconds: 43200 + - uses: iterative/setup-dvc@v1 + - name: Generate repo + run: | + pip install virtualenv + cd example-get-started + ./generate.sh true + - name: Deploy repo + env: + GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run: | + # add remote + cd example-get-started/build/example-get-started + git remote add origin https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/iterative/example-get-started.git + # close open PRs + gh pr close try-large-dataset + gh pr close tune-hyperparams + # drop existing refs + git ls-remote origin | awk '{print $2}' | xargs -n 1 git push --delete origin || true + # force push branches + git push --force origin main + git push --force origin try-large-dataset + git push --force origin tune-hyperparams + # we push git tags one by one for Studio to receive webhooks: + git tag --sort=creatordate | xargs -n 1 git push --force origin + # push exp refs + dvc exp push origin -A + # create PRs + gh pr create -t "Try 40K dataset (4x data)" \ + -b "We are trying here a large dataset, since the smaller one looks unstable" \ + -B main -H try-large-dataset + gh pr create -t "Run experiments tuning random forest params" \ + -b "Better RF split and number of estimators based on small grid search." \ + -B main -H tune-hyperparams diff --git a/.github/workflows/example-get-started-test.yaml b/.github/workflows/example-get-started-test.yaml index f7fe9a8..ffd9b86 100644 --- a/.github/workflows/example-get-started-test.yaml +++ b/.github/workflows/example-get-started-test.yaml @@ -3,7 +3,12 @@ on: push: paths: - example-get-started/** + branches: + - '**' # matches every branch + - '!master' # excludes master workflow_dispatch: + schedule: + - cron: '0 0 * * 1' permissions: contents: read id-token: write diff --git a/README.md b/README.md index 5df0d4b..ba354d5 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,14 @@ $ ./deploy.sh ### example-get-started -You only directly need `generate.sh`. `deploy.sh` is a helper script run within -`generate.sh`. +There are 2 GitHub Actions set up to test and deploy the project: + +- [test](.github/workflows/example-get-started-test.yaml) +- [deploy](.github/workflows/example-get-started-deploy.yaml) + +These will automatically test and deploy the project. If you need to run the project +locally/manually, you only directly need `generate.sh`. `deploy.sh` is a helper script +run within `generate.sh`. - `generate.sh`: Generates the `example-get-started` DVC project from scratch. diff --git a/example-get-started/README.md b/example-get-started/README.md index baf0373..2b3f0f6 100644 --- a/example-get-started/README.md +++ b/example-get-started/README.md @@ -24,10 +24,10 @@ For the basic use case (docs and Studio demo), use the command below. ``` If change source code, to publish it on S3 (needed for the get started tutorial) -pass `true` to the command. It's needed when you ready to publish it. +pass `prod` to the command. It's needed when you ready to publish it. ```shell -./generate.sh true +./generate.sh prod ``` The repo generated in `build/example-get-started` is intended to be published on