Skip to content

workflow: inject SECRETs #9

workflow: inject SECRETs

workflow: inject SECRETs #9

Workflow file for this run

name: Build
on:
push:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
env:
KEY: ${{ secrets.KEY }}
LATITUDE: ${{ secrets.LATITUDE }}
LONGITUDE: ${{ secrets.LONGITUDE }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Install web-ext
run: npm install --global web-ext
- name: Inject environment variables into weather.js
run: |
sed -i 's/const KEY = "";/const KEY = "${{ secrets.KEY }}";/' src/weather.js
sed -i 's/const LATITUDE = 0;/const LATITUDE = ${ { secrets.LATITUDE }};/' src/weather.js
sed -i 's/const LONGITUDE = 0;/const LONGITUDE = ${ { secrets.LONGITUDE }};/' src/weather.js
- name: Build and Sign extension
env:
FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }}
FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }}
run: |
web-ext sign \
--channel=unlisted \
--api-key=$FIREFOX_JWT_ISSUER \
--api-secret=$FIREFOX_JWT_SECRET
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: firefox-extension
path: web-ext-artifacts/*.xpi