Release v9.0.1 to staging #118
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
--- | |
name: release | |
run-name: Release ${{ github.event.client_payload.ref }}${{ github.event.inputs.ref }} to ${{ github.event.inputs.environment }}${{ github.event.client_payload.environment }} | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
description: Environment to release | |
required: true | |
default: production | |
ref: | |
description: Ref to release | |
required: true | |
default: master | |
repository_dispatch: | |
types: | |
- release | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.client_payload.ref }}${{ github.event.inputs.ref }} | |
- name: Start deployment | |
uses: bobheadxi/deployments@v1 | |
id: deployment | |
with: | |
step: start | |
env: ${{ github.event.inputs.environment }}${{ github.event.client_payload.environment }} | |
desc: ${{ github.event.client_payload.ref }}${{ github.event.client_payload.ref }} | |
ref: ${{ github.event.client_payload.ref }}${{ github.event.inputs.ref }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_DEFAULT_REGION }} | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Serverless deploy to production from ${{ github.event.client_payload.ref }}${{ github.event.inputs.ref }} | |
run: npm run deploy | |
if: ${{ github.event.inputs.environment == 'production' || github.event.client_payload.environment == 'production' }} | |
env: | |
SERVERLESS_STAGE: prod | |
- name: Serverless deploy to staging from ${{ github.event.client_payload.ref }}${{ github.event.inputs.ref }} | |
run: npm run deploy | |
if: ${{ github.event.inputs.environment == 'staging' || github.event.client_payload.environment == 'staging' }} | |
env: | |
SERVERLESS_STAGE: stg | |
- name: Finish deployment | |
uses: bobheadxi/deployments@v1 | |
if: always() | |
with: | |
step: finish | |
status: ${{ job.status }} | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} | |
env: ${{ steps.deployment.outputs.env }} | |
token: ${{ secrets.GITHUB_TOKEN }} |