Skip to content

Commit

Permalink
feat: add scaleway provider (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChatoDeVeirman authored Jan 31, 2023
1 parent a70db2d commit 6a308d9
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/workflows/scaleway.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
workflow_dispatch:

jobs:
use_s3cmd:
runs-on: ubuntu-latest

name: Use S3cmd for digitalocean
steps:
- name: Set up S3cmd cli tool
uses: s3-actions/s3cmd@main
with:
provider: scaleway
region: fr-par
access_key: ${{ secrets.SCW_ACCESS_KEY_ID }}
secret_key: ${{ secrets.SCW_SECRET_ACCESS_KEY }}

- name: Interact with object storage
run: |
buck="github-action-${{ github.run_id }}"
mkdir example
s3cmd mb s3://$buck
echo 'foo' >> example/bar
s3cmd put example/bar s3://$buck
mkdir -p example/baz/bar
echo 'fizz' >> example/baz/bar/faz
sleep 10
s3cmd sync --recursive --acl-public example s3://$buck
sleep 10
s3cmd rm -r --force s3://$buck
sleep 10
s3cmd rb s3://$buck
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
.s3cfg
/assets/test-results/*
!/assets/test-results/.gitkeep
.idea
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ Currently the below providers are supported, but it could be used with other pro
- AWS
- Linode
- DigitalOcean
- Scaleway

## Inputs

### `provider`

**Not Required** The s3 provider to use. Defaults to Linode. AWS, Linode, DigitalOcean are supported.
**Not Required** The s3 provider to use. Defaults to Linode. AWS, Linode, DigitalOcean, Scaleway are supported.

### `secret_key`

Expand Down
8 changes: 8 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,14 @@ const providers = {
website_endpoint: `http://%(bucket)s.website-${region}.linodeobjects.com/`,
access_key,
secret_key,
}),
scaleway: ({ region = 'fr-par', access_key = '', secret_key = '' }) => ({
bucket_location: region,
host_base: `s3.${region}.scw.cloud`,
host_bucket: `%(bucket)s.s3.${region}.scw.cloud`,
website_endpoint: `https://%(bucket)s.s3-website.${region}.scw.cloud/`,
access_key,
secret_key,
})
}

Expand Down
8 changes: 8 additions & 0 deletions src/providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ const providers = {
website_endpoint: `http://%(bucket)s.website-${region}.linodeobjects.com/`,
access_key,
secret_key,
}),
scaleway: ({ region = 'fr-par', access_key = '', secret_key = '' }) => ({
bucket_location: region,
host_base: `s3.${region}.scw.cloud`,
host_bucket: `%(bucket)s.s3.${region}.scw.cloud`,
website_endpoint: `https://%(bucket)s.s3-website.${region}.scw.cloud/`,
access_key,
secret_key,
})
}

Expand Down

0 comments on commit 6a308d9

Please sign in to comment.