-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (55 loc) · 1.96 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Generate tags and Deploy
on:
workflow_dispatch
jobs:
release-tags:
name: Generate Release Tags
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: v2
- name: Get the latest version
id: get_version
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: v${{ steps.get_version.outputs.version }}
release_name: v${{ steps.get_version.outputs.version }}
body: |
Release v${{ steps.get_version.outputs.version }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
name: Deploy to AWS S3
runs-on: ubuntu-latest
env:
AWS_S3_BUCKET: tarka-public-libraries
AWS_REGION: ap-south-1
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: v2
- name: Get the latest version
id: get_version
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
- name: Rename build files
run: |
current_version=$(echo "${{ steps.get_version.outputs.version }}")
mv dist/tarka-chat.es.js "dist/tarka-chat-${current_version}.es.js"
mv dist/tarka-chat.umd.js "dist/tarka-chat-${current_version}.umd.js"
- name: Push the files to S3 bucket
uses: jakejarvis/s3-sync-action@master
env:
SOURCE_DIR: 'dist'
AWS_S3_BUCKET: ${{ env.AWS_S3_BUCKET }}
AWS_REGION: ${{ env.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}