Skip to content

Commit 0f8d9ef

Browse files
authored
fix: update github actions example. (#38)
* fix: update github actions example. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: update github actions example readme.
1 parent 34717ec commit 0f8d9ef

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

examples/github_actions/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,16 @@ This example provides a simple Github Action configuration file to get you start
44

55
To do so, simply copy the `deploy.yml` file in `.github/workflows`.
66

7-
This example will automatically run `scw-serverless deploy` in the project root to deploy your on each git tag.
7+
Then set the following variables on your [Github Action Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets):
8+
9+
- `SCW_SECRET_KEY`: your user secret key
10+
- `SCW_ACCESS_KEY`: your user access key
11+
- `SCW_DEFAULT_PROJECT_ID`: your default project ID
12+
13+
14+
This example will automatically run `scw-serverless deploy` in the project root to deploy your function on each git tag.
15+
16+
You can specify another deployment region (fr-par is the by-default deployment region) using for example:
17+
```
18+
scw-serverless deploy --region pl-waw app.py
19+
```

examples/github_actions/deploy.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
name: Deploy to scaleway's serverless functions
44

5-
on: tags
5+
on:
6+
push:
7+
- tags:
8+
- '*'
69

710
permissions:
811
contents: read
@@ -24,4 +27,8 @@ jobs:
2427
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
2528
- name: Deploy to scaleway's serverless functions
2629
run: |
27-
scw-serverless deploy
30+
scw-serverless deploy app.py
31+
env:
32+
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
33+
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }}
34+
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}

0 commit comments

Comments
 (0)