From f28f9996b65ca983420189ba787d656c9d5b9ca8 Mon Sep 17 00:00:00 2001 From: rnoureddine Date: Mon, 20 Feb 2023 10:02:22 +0100 Subject: [PATCH 1/3] fix: update github actions example. --- examples/github_actions/README.md | 7 ++++++- examples/github_actions/deploy.yml | 13 ++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/examples/github_actions/README.md b/examples/github_actions/README.md index c7efb77..09d0e72 100644 --- a/examples/github_actions/README.md +++ b/examples/github_actions/README.md @@ -4,4 +4,9 @@ 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. +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..db07f00 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 @@ -23,5 +26,9 @@ jobs: python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Deploy to scaleway's serverless functions - run: | - scw-serverless deploy + run: | + 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 }} \ No newline at end of file From 2b254c67fe1a647e02629d474cb3074e9057c685 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 09:13:07 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/github_actions/deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/github_actions/deploy.yml b/examples/github_actions/deploy.yml index db07f00..5363f4b 100644 --- a/examples/github_actions/deploy.yml +++ b/examples/github_actions/deploy.yml @@ -2,7 +2,7 @@ name: Deploy to scaleway's serverless functions -on: +on: push: - tags: - '*' @@ -26,9 +26,9 @@ jobs: python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Deploy to scaleway's serverless functions - run: | + run: | 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 }} \ No newline at end of file + SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }} From e2de1703fc7bd38d036688da16223d305aaacfd0 Mon Sep 17 00:00:00 2001 From: rnoureddine Date: Mon, 20 Feb 2023 11:25:28 +0100 Subject: [PATCH 3/3] fix: update github actions example readme. --- examples/github_actions/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/github_actions/README.md b/examples/github_actions/README.md index 09d0e72..2e51a8b 100644 --- a/examples/github_actions/README.md +++ b/examples/github_actions/README.md @@ -4,6 +4,13 @@ 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`. +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: