publish-stable-aws #79
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: publish-stable-aws | |
on: | |
repository_dispatch: | |
types: [publish-stable-aws] | |
jobs: | |
aws-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
registry-url: https://registry.npmjs.org/ | |
- name: 'Install makensis (apt)' | |
run: sudo apt update && sudo apt install -y nsis nsis-pluginapi | |
- name: Deploy on AWS | |
run: | | |
yarn install --ignore-scripts | |
yarn release | |
yarn release:win | |
env: | |
IS_CI: "true" | |
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}} | |
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}} | |
publish-success: | |
runs-on: ubuntu-latest | |
needs: [aws-publish] | |
steps: | |
- name: Get deploy version | |
id: deployed-version | |
run: echo '::set-output name=SOURCE_TAG::$(curl https://api.github.com/repos/vtex/toolbelt/releases/latest -s | jq .tag_name -r)' | |
- name: Trigger slack notification bot [Success] | |
run: 'curl --connect-timeout 30 --retry 3 --retry-delay 120 --data "status=success&user=${{ github.actor }}&platform=AWS-S3&version=${{ steps.deployed-version.outputs.SOURCE_TAG }}" --header "token: ${{ secrets.TOOLBELT_NOTIFICATION_KEY }}" https://master--vtex.myvtex.com/_v/public/toolbelt-notification/status' | |
- name: Trigger publish-stable-brew | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.REPO_GHA_PAT }} | |
repository: vtex/homebrew-vtex | |
event-type: publish-stable-brew | |
publish-failed: | |
runs-on: ubuntu-latest | |
needs: [aws-publish] | |
if: failure() | |
steps: | |
- name: Get deploy version | |
id: deployed-version | |
run: echo '::set-output name=SOURCE_TAG::$(curl https://api.github.com/repos/vtex/toolbelt/releases/latest -s | jq .tag_name -r)' | |
- name: Trigger slack notification bot [Fail] | |
run: 'curl --connect-timeout 30 --retry 3 --retry-delay 120 --data "status=failed&user=${{ github.actor }}&platform=AWS-S3&version=${{ steps.deployed-version.outputs.SOURCE_TAG }}" --header "token: ${{ secrets.TOOLBELT_NOTIFICATION_KEY }}" https://master--vtex.myvtex.com/_v/public/toolbelt-notification/status' |