-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (41 loc) · 1.52 KB
/
deploy-to-prod.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
name: Deploy current version to Scaleway Serverless Container
on: workflow_dispatch
env:
CONTAINER_ID: ${{ vars.SCW_CONTAINER_ID }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
CONTAINER_HTTP_OPTION: redirected
jobs:
deploy-to-prod:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Get the current container
uses: scaleway/action-scw@v0
id: container
with:
access-key: ${{ vars.SCW_ACCESS_KEY }}
secret-key: ${{ secrets.SCW_SECRET_KEY }}
default-project-id: ${{ vars.SCW_DEFAULT_PROJECT_ID }}
default-organization-id: ${{ vars.SCW_DEFAULT_ORGANIZATION_ID }}
args: container container get ${{ env.CONTAINER_ID }}
- name: Get Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Update the container with current tag
uses: scaleway/action-scw@v0
with:
access-key: ${{ vars.SCW_ACCESS_KEY }}
secret-key: ${{ secrets.SCW_SECRET_KEY }}
default-project-id: ${{ vars.SCW_DEFAULT_PROJECT_ID }}
default-organization-id: ${{ vars.SCW_DEFAULT_ORGANIZATION_ID }}
args: >
container container update ${{ env.CONTAINER_ID }}
registry-image=${{ steps.meta.outputs.tags }}
http-option=${{ env.CONTAINER_HTTP_OPTION }}