Skip to content

Release gist-web

Release gist-web #37

Workflow file for this run

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 }}