-
Notifications
You must be signed in to change notification settings - Fork 6
48 lines (45 loc) · 1.41 KB
/
release.yml
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
name: Release Gist Web
run-name: Release gist-web
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.GIST_WEB_AWS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.GIST_WEB_AWS_SECRET_ACCESS_KEY }}
AWS_BUCKET: 'gist-code'
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: 16
- name: Build
shell: bash
run: |
npm install
npm run build:prod
- name: Version name
shell: bash
run: |
RELEASE_VERSION="${GITHUB_REF#refs/*/}"
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "RELEASE_VERSION=$RELEASE_VERSION"
AWS_DEST="web/$RELEASE_VERSION"
echo "AWS_DEST=$AWS_DEST" >> $GITHUB_ENV
echo "AWS_DEST=$AWS_DEST"
- uses: shallwefootball/s3-upload-action@master
with:
aws_key_id: ${{ env.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws_bucket: ${{ env.AWS_BUCKET }}
source_dir: 'dist'
destination_dir: ${{ env.AWS_DEST }}
endpoint: 'ams3.digitaloceanspaces.com'
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}