diff --git a/examples/github_actions/README.md b/examples/github_actions/README.md index c7efb77..2e51a8b 100644 --- a/examples/github_actions/README.md +++ b/examples/github_actions/README.md @@ -4,4 +4,16 @@ This example provides a simple Github Action configuration file to get you start To do so, simply copy the `deploy.yml` file in `.github/workflows`. -This example will automatically run `scw-serverless deploy` in the project root to deploy your on each git tag. +Then set the following variables on your [Github Action Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets): + +- `SCW_SECRET_KEY`: your user secret key +- `SCW_ACCESS_KEY`: your user access key +- `SCW_DEFAULT_PROJECT_ID`: your default project ID + + +This example will automatically run `scw-serverless deploy` in the project root to deploy your function on each git tag. + +You can specify another deployment region (fr-par is the by-default deployment region) using for example: +``` +scw-serverless deploy --region pl-waw app.py +``` diff --git a/examples/github_actions/deploy.yml b/examples/github_actions/deploy.yml index 8f3fce8..5363f4b 100644 --- a/examples/github_actions/deploy.yml +++ b/examples/github_actions/deploy.yml @@ -2,7 +2,10 @@ name: Deploy to scaleway's serverless functions -on: tags +on: + push: + - tags: + - '*' permissions: contents: read @@ -24,4 +27,8 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Deploy to scaleway's serverless functions run: | - scw-serverless deploy + scw-serverless deploy app.py + env: + SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} + SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} + SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}