-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
56 lines (56 loc) · 2.08 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Scaleway Serverless Container Deploy
description: Allows you to deploy your Docker containers in to Scaleway Serverless beta.
author: Matt Copperwaite
branding:
icon: 'grid'
color: 'purple'
inputs:
region:
description: |
Scaleway region ID.
Currently only fr-par supports Serverless but could also be nl-ams or pl-waw in future.
required: true
default: 'fr-par'
container_id:
description: |
The UUID of the container.
This Action does not create containers, only update existing ones. You therefore need a container to be created initially, and take the ID from that.
The ID can be found in the URL, or the API.
required: true
secret_key:
description: |
The secret API key used to access Scaleway.
This is generated from the Credentials page.
This key must be for the right Organization.
The key must have access to the Container Registry and theServerless
Note that Access Key is not used,
required: true
registry_image_url:
description: |
The URL for the registry, image, and version to use in the container.
i.e.: rg.fr-par.scw.cloud/example-registry/example-image:latest
required: true
api_version:
description: |
The version of the API to compare against.
required: false
default: 'v1beta1'
runs:
using: "composite"
steps:
- name: Update container with new image version
shell: bash
run: >
curl \
--request PATCH \
--header "X-Auth-Token: ${{ inputs.secret_key }}" \
--data '{"redeploy": true, "registry_image": "${{ inputs.registry_image_url }}"}' \
https://api.scaleway.com/functions/${{ inputs.api_version }}/regions/${{ inputs.region }}/containers/${{ inputs.container_id }}
- name: Redeploy container
shell: bash
run: >
curl \
--request POST \
--header "X-Auth-Token:${{ inputs.secret_key }}" \
--data '{}' \
https://api.scaleway.com/functions/${{ inputs.api_version }}/regions/${{ inputs.region }}/containers/${{ inputs.container_id }}/deploy