Yolo regenerate #44
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: Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
deploy-s3: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone Repo | |
uses: actions/checkout@master | |
- name: Setup Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: NPM Install | |
run: | | |
npm install | |
env: | |
CI: true | |
- name: Build Site | |
run: | | |
cd nulinks-site | |
npm run build | |
env: | |
CI: true | |
- name: Upload to S3 | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --acl public-read | |
env: | |
SOURCE_DIR: './nulinks-site/build' | |
AWS_REGION: 'us-east-1' | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
deploy-cws: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone Repo | |
uses: actions/checkout@master | |
- name: Setup Node.js 20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: Build Project | |
run: | | |
# Install | |
npm install | |
cd nulinks-site | |
npm run build | |
cd .. | |
env: | |
CI: true | |
- name: Build Extension | |
run: | | |
BUILD_NUM=$(git rev-list --count HEAD --first-parent) | |
pushd . > /dev/null | |
# Set up the folder structure that we'll need | |
mkdir -p /tmp/nulinks/nulinks-extension | |
# Copy extension files | |
cp -Rp nulinks-extension/* /tmp/nulinks/nulinks-extension | |
# Copy common files | |
# Remove the symbolic link | |
rm /tmp/nulinks/nulinks-extension/nulinks-common | |
# Copy files | |
mkdir -p /tmp/nulinks/nulinks-extension/nulinks-common | |
cp -Rp nulinks-common/* /tmp/nulinks/nulinks-extension/nulinks-common | |
# Copy site build files | |
mkdir -p /tmp/nulinks/nulinks-extension/pages | |
cp -Rp nulinks-site/build/* /tmp/nulinks/nulinks-extension/pages | |
# Remove site's manifest | |
rm /tmp/nulinks/nulinks-extension/pages/manifest.json | |
# Remove other extra files | |
rm /tmp/nulinks/nulinks-extension/nulinks-common/package.json | |
rm /tmp/nulinks/nulinks-extension/nulinks-common/package-lock.json | |
rm -f /tmp/nulinks/nulinks-extension/nulinks-common/junit.xml | |
rm -rf /tmp/nulinks/nulinks-extension/nulinks-common/node_modules | |
rm -rf /tmp/nulinks/nulinks-extension/nulinks-common/test | |
# Add the build number to the version in the manifest | |
cd /tmp/nulinks/nulinks-extension | |
jq ".version+=\".$BUILD_NUM\"" manifest.json > manifest.tmp.json && mv manifest.tmp.json manifest.json | |
cd .. | |
# Build the zip file | |
zip -r nulinks-extension.zip nulinks-extension | |
# Restore the CWD | |
popd > /dev/null | |
# Copy the zip back here | |
cp /tmp/nulinks/nulinks-extension.zip . | |
env: | |
CI: true | |
- name: Upload Extension Artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: extension | |
path: nulinks-extension.zip | |
- name: Upload to Chrome Webstore | |
run: | | |
npx chrome-webstore-upload-cli upload --source nulinks-extension.zip --extension-id gfbdcgkehhkgfehdilpmldkeihiojjak --auto-publish | |
env: | |
CLIENT_ID: ${{ secrets.CWS_CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CWS_CLIENT_SECRET }} | |
REFRESH_TOKEN: ${{ secrets.CWS_REFRESH_TOKEN }} |