update #14
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 commit. | |
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' | |
# TODO: Cache dependencies | |
- 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: 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 "Update data" | |
git push | |
# TODO: Change patch > minor here | |
- name: Increment version | |
run: | | |
npm version patch | |
git push | |
git push --tags | |
- 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 | |
# - 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 }} |