Skip to content

Commit 6a308d9

Browse files
feat: add scaleway provider (#8)
1 parent a70db2d commit 6a308d9

File tree

5 files changed

+51
-1
lines changed

5 files changed

+51
-1
lines changed

.github/workflows/scaleway.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
workflow_dispatch:
3+
4+
jobs:
5+
use_s3cmd:
6+
runs-on: ubuntu-latest
7+
8+
name: Use S3cmd for digitalocean
9+
steps:
10+
- name: Set up S3cmd cli tool
11+
uses: s3-actions/s3cmd@main
12+
with:
13+
provider: scaleway
14+
region: fr-par
15+
access_key: ${{ secrets.SCW_ACCESS_KEY_ID }}
16+
secret_key: ${{ secrets.SCW_SECRET_ACCESS_KEY }}
17+
18+
- name: Interact with object storage
19+
run: |
20+
buck="github-action-${{ github.run_id }}"
21+
mkdir example
22+
s3cmd mb s3://$buck
23+
echo 'foo' >> example/bar
24+
s3cmd put example/bar s3://$buck
25+
mkdir -p example/baz/bar
26+
echo 'fizz' >> example/baz/bar/faz
27+
sleep 10
28+
s3cmd sync --recursive --acl-public example s3://$buck
29+
sleep 10
30+
s3cmd rm -r --force s3://$buck
31+
sleep 10
32+
s3cmd rb s3://$buck

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules
22
.s3cfg
33
/assets/test-results/*
44
!/assets/test-results/.gitkeep
5+
.idea

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ Currently the below providers are supported, but it could be used with other pro
99
- AWS
1010
- Linode
1111
- DigitalOcean
12+
- Scaleway
1213

1314
## Inputs
1415

1516
### `provider`
1617

17-
**Not Required** The s3 provider to use. Defaults to Linode. AWS, Linode, DigitalOcean are supported.
18+
**Not Required** The s3 provider to use. Defaults to Linode. AWS, Linode, DigitalOcean, Scaleway are supported.
1819

1920
### `secret_key`
2021

dist/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,14 @@ const providers = {
453453
website_endpoint: `http://%(bucket)s.website-${region}.linodeobjects.com/`,
454454
access_key,
455455
secret_key,
456+
}),
457+
scaleway: ({ region = 'fr-par', access_key = '', secret_key = '' }) => ({
458+
bucket_location: region,
459+
host_base: `s3.${region}.scw.cloud`,
460+
host_bucket: `%(bucket)s.s3.${region}.scw.cloud`,
461+
website_endpoint: `https://%(bucket)s.s3-website.${region}.scw.cloud/`,
462+
access_key,
463+
secret_key,
456464
})
457465
}
458466

src/providers.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ const providers = {
2424
website_endpoint: `http://%(bucket)s.website-${region}.linodeobjects.com/`,
2525
access_key,
2626
secret_key,
27+
}),
28+
scaleway: ({ region = 'fr-par', access_key = '', secret_key = '' }) => ({
29+
bucket_location: region,
30+
host_base: `s3.${region}.scw.cloud`,
31+
host_bucket: `%(bucket)s.s3.${region}.scw.cloud`,
32+
website_endpoint: `https://%(bucket)s.s3-website.${region}.scw.cloud/`,
33+
access_key,
34+
secret_key,
2735
})
2836
}
2937

0 commit comments

Comments
 (0)