Skip to content

Remove LocalMonero (#8129) #21

Remove LocalMonero (#8129)

Remove LocalMonero (#8129) #21

Workflow file for this run

name: Publish
on:
push:
branches:
- master
paths:
- 'entries/**'
- 'img/**'
concurrency:
group: 'publish'
cancel-in-progress: true
jobs:
publish:
name: Build and Publish files
if: github.repository == '2factorauth/twofactorauth'
permissions:
pages: write
id-token: write
environment: production
runs-on: ubuntu-latest
steps:
- 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: Get modified files
id: diff
run: |
ENTRIES=$(git diff --name-only HEAD^ entries/| tr '\n' ' ')
if [ -n "$ENTRIES" ]; then
echo "entries=${ENTRIES}" >> $GITHUB_OUTPUT
fi
- name: Generate API files
run: node scripts/APIv3.js
- name: Publish changes to Algolia
if: steps.diff.outputs.entries
run: node scripts/Algolia.js ${{ steps.diff.outputs.entries }}
env:
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_INDEX_NAME: ${{ vars.ALGOLIA_INDEX_NAME }}
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
- uses: crazy-max/ghaction-import-gpg@v5
id: pgp
with:
gpg_private_key: ${{ secrets.PGP_KEY }}
passphrase: ${{ secrets.PGP_PASSWORD }}
- name: Sign API files
run: bash scripts/Sign.rb
env:
PGP_PASSWORD: ${{ secrets.PGP_PASSWORD }}
PGP_KEY_ID: ${{ steps.pgp.outputs.keyid }}
- name: Prepare publish directory
run: |
mkdir -p public/icons
cp -r api/. public/
cp -r img/. public/icons/
cp robots.txt public/
- uses: actions/upload-pages-artifact@v1
with:
path: public/
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v1
- name: Send webhook to Cloudflare
run: curl -X POST -IL "${{ secrets.WEBHOOK }}" -o /dev/null -w '%{http_code}\n' -s