2022-04-05 14:26:17 +02:00
|
|
|
name: 'Release unleash-frontend'
|
2022-01-05 11:34:47 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [14.x]
|
|
|
|
|
|
|
|
steps:
|
2022-03-25 10:18:06 +01:00
|
|
|
- uses: actions/checkout@v3
|
2022-04-05 15:20:56 +02:00
|
|
|
- name: Publish to npm
|
2022-03-25 09:50:01 +01:00
|
|
|
uses: actions/setup-node@v3
|
2022-01-05 11:34:47 +01:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2022-04-05 15:20:56 +02:00
|
|
|
registry-url: 'https://registry.npmjs.org'
|
2022-04-05 14:48:44 +02:00
|
|
|
- run: |
|
2022-04-07 11:33:07 +02:00
|
|
|
yarn install --frozen-lockfile
|
2022-04-05 15:23:22 +02:00
|
|
|
- run: |
|
2022-04-05 14:48:44 +02:00
|
|
|
TAG=$(echo $GITHUB_REF_NAME | grep -oP '^v\d+\.\d+\.\d+-?\K(\w+)?')
|
|
|
|
npm publish --tag ${TAG:-latest}
|
|
|
|
env:
|
2022-04-05 15:20:56 +02:00
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
2022-01-05 11:34:47 +01:00
|
|
|
- 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 }}
|
2022-01-05 11:56:13 +01:00
|
|
|
- name: Get the version
|
|
|
|
id: get_version
|
|
|
|
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
2022-04-05 14:26:17 +02:00
|
|
|
- name: Publish static assets to S3
|
2022-01-05 11:34:47 +01:00
|
|
|
run: |
|
2022-01-05 13:37:39 +01:00
|
|
|
aws s3 cp build/ s3://getunleash-static/unleash/${{ steps.get_version.outputs.VERSION }} --recursive
|