update #7
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
# Manually pull latest data, build the site, and deploy to production | |
name: update | |
on: | |
workflow_dispatch: | |
env: | |
DRIVE_CREDENTIALS: ${{ secrets.DRIVE_CREDENTIALS }} | |
NODE_ENV: CI | |
PORT: 3000 | |
permissions: | |
contents: write | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
environment: | |
name: 'Production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
- name: Install dependencies | |
run: npm ci | |
- name: Update bibliography | |
run: node bin/updateBibliography.js | |
- name: Update database | |
run: node bin/updateDatabase.js | |
- name: Build app | |
run: npm run build | |
- name: Update docs | |
run: node bin/updateDocs.js | |
- name: Check for "only" in tests | |
run: npm run stop-only | |
- name: Run E2E tests | |
run: npm test | |
- name: Commit changes | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "Data Update" | |
git push | |
- name: Increment version | |
run: | | |
npm version minor | |
git push | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: nisinoon | |
slot-name: Production | |
package: . | |
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_C789F3DAFFFF45EA89AA17889914203C }} | |
# - name: Copy data | |
# uses: peaceiris/actions-gh-pages@v4 | |
# with: | |
# enable_jekyll: true | |
# exclude_assets: '**.js,bad-links.csv,credentials.json,issues.csv,models,transliterations,tags,utilities' | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_branch: data | |
# publish_dir: data | |
- name: Create a Zenodo release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body: 'This is a release to archive data with Zenodo.' | |
files: | | |
data/README.md | |
data/csv | |
data/json |