23 configuration options for autoscaling #138
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# only serve a purpose to live test | |
name: Deploy | |
on: | |
pull_request: | |
types: ['opened', 'edited', 'reopened', 'synchronize'] | |
push: | |
branches: | |
- main | |
workflow_call: | |
# Map the workflow outputs to job outputs | |
outputs: | |
container_id: | |
description: "ID of your container inside your namespace" | |
value: ${{ jobs.deploy.outputs.scw_container_id }} | |
namespace_id: | |
description: "ID of your container namespace" | |
value: ${{ jobs.deploy.outputs.scw_namespace_id }} | |
jobs: | |
deploy-scaleway-container: | |
runs-on: ubuntu-latest | |
name: deploy scaleway serverless container | |
steps: | |
# To use this repository's private action, | |
# you must check out the repository | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Export custom variables | |
run: | | |
SAFE_GITHUB_HEAD_REF_SLUG_URL=$(echo $GITHUB_HEAD_REF | rev | cut -c-37 | rev) | |
([[ $GITHUB_REF == 'refs/heads/main' ]] && echo "BRANCH_SLUG=main" || echo "BRANCH_SLUG=$SAFE_GITHUB_HEAD_REF_SLUG_URL") >> $GITHUB_ENV | |
- uses: hmarr/debug-action@v2 | |
- name: Start deployment | |
uses: bobheadxi/[email protected] | |
id: deployment | |
with: | |
step: start | |
token: ${{ secrets.GH_TOKEN }} | |
env: ${{ env.BRANCH_SLUG }} | |
ref: ${{ github.head_ref }} | |
debug: true | |
- name: Scaleway Container Deploy action | |
id: deploy | |
uses: ./ # Uses an action in the root directory | |
with: | |
type: deploy | |
scw_access_key: ${{ secrets.ACCESS_KEY }} | |
scw_secret_key: ${{ secrets.SECRET_KEY }} | |
scw_containers_namespace_id: ae28eaf1-3b94-4660-bce0-9b0e0a5d1062 | |
scw_registry: rg.fr-par.scw.cloud/aphilibeaux/scaleway-form:latest | |
scw_dns: containers.philibeaux.fr | |
root_zone: true | |
- name: check output | |
shell: bash | |
run: | | |
echo "${{ steps.deploy.outputs.url }}" | |
echo "${{ steps.deploy.outputs.container_url }}" | |
echo "${{ steps.deploy.outputs.scw_container_id }}" | |
echo "${{ steps.deploy.outputs.scw_namespace_id }}" | |
- name: Update deployment status | |
uses: bobheadxi/[email protected] | |
if: always() | |
with: | |
debug: true | |
step: finish | |
env: ${{ env.BRANCH_SLUG }} | |
token: ${{ secrets.GH_TOKEN }} | |
status: ${{ job.status }} | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} | |
env_url: ${{ steps.deploy.outputs.url }} | |
teardown-scaleway-container: | |
name: teardown scaleway serverless container | |
needs: deploy-scaleway-container | |
runs-on: ubuntu-latest | |
steps: | |
# To use this repository's private action, | |
# you must check out the repository | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Export custom variables | |
run: | | |
SAFE_GITHUB_HEAD_REF_SLUG_URL=$(echo $GITHUB_HEAD_REF | rev | cut -c-37 | rev) | |
([[ $GITHUB_REF == 'refs/heads/main' ]] && echo "BRANCH_SLUG=main" || echo "BRANCH_SLUG=$SAFE_GITHUB_HEAD_REF_SLUG_URL") >> $GITHUB_ENV | |
- uses: hmarr/debug-action@v2 | |
- name: Scaleway Container Teardown action | |
id: deploy | |
uses: ./ # Uses an action in the root directory | |
with: | |
type: teardown | |
scw_access_key: ${{ secrets.ACCESS_KEY }} | |
scw_secret_key: ${{ secrets.SECRET_KEY }} | |
scw_containers_namespace_id: ae28eaf1-3b94-4660-bce0-9b0e0a5d1062 | |
scw_registry: rg.fr-par.scw.cloud/aphilibeaux/scaleway-form:latest | |
scw_dns: containers.philibeaux.fr | |
root_zone: true | |
- name: check output | |
shell: bash | |
run: | | |
echo "${{ steps.deploy.outputs.url }}" | |
echo "${{ steps.deploy.outputs.container_url }}" | |
echo "${{ steps.deploy.outputs.scw_container_id }}" | |
echo "${{ steps.deploy.outputs.scw_namespace_id }}" | |
- name: Update deployment status | |
uses: bobheadxi/[email protected] | |
if: always() | |
with: | |
debug: true | |
step: delete-env | |
token: ${{ secrets.GH_TOKEN }} | |
env: ${{ env.BRANCH_SLUG }} |