Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
chore(deploy): serverless containers
Browse files Browse the repository at this point in the history
  • Loading branch information
philibea committed Feb 24, 2022
1 parent fe530e3 commit be6804c
Showing 1 changed file with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy
name: Deploy Storybook

on:
pull_request:
Expand All @@ -9,10 +9,10 @@ on:

jobs:
deploy:
name: Deploy
runs-on: ubuntu-20.04
env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/scaleway-form
REMOTE_SSH_SERVER: ssh://[email protected]
IMAGE_NAME: rg.fr-par.scw.cloud/consolescw/scaleway-form
steps:
- uses: actions/[email protected]
- name: Cache Docker layers
Expand Down Expand Up @@ -41,12 +41,12 @@ jobs:
ref: ${{ github.head_ref }}
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to GHCR
- name: Login to Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
registry: rg.fr-par.scw.cloud
username: nologin
password: ${{ secrets.SCW_SECRET_TOKEN }}
- name: Build
uses: docker/[email protected]
env:
Expand All @@ -57,17 +57,17 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Set Docker context
uses: arwynfr/actions-docker-context@v2
- name: Deploy Serverless Container Scaleway
uses: philibea/[email protected]
id: deploy
with:
docker_host: ${{ env.REMOTE_SSH_SERVER }}
context_name: form-v-${{ env.BRANCH_SLUG }}
ssh_cert: ${{ secrets.SSH_CERT }}
ssh_key: ${{ secrets.SSH_KEY }}
- name: Deploy docker
env:
VERSION: v-${{ env.BRANCH_SLUG }}
run: docker-compose --context form-${VERSION} pull && docker-compose -p form-${VERSION} --context form-${VERSION} up -d --force-recreate
type: "deploy"
scw_access_key: ${{ secrets.ACCESS_KEY }}
scw_secret_key: ${{ secrets.SECRET_KEY }}
scw_containers_namespace_id: "58096e1c-c903-4fa5-af46-f721f2574a2f"
scw_registry: ${{ env.IMAGE_NAME }}:v-${{ env.BRANCH_SLUG }}
scw_container_port: "80"
env_url: ${{ steps.deploy.outputs.url }}

- name: Update deployment status
uses: bobheadxi/[email protected]
Expand Down

0 comments on commit be6804c

Please sign in to comment.