Skip to content

fix: update github actions example. #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion examples/github_actions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
11 changes: 9 additions & 2 deletions examples/github_actions/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

name: Deploy to scaleway's serverless functions

on: tags
on:
push:
- tags:
- '*'

permissions:
contents: read
Expand All @@ -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 }}