Generate and Deploy #1003
This file contains hidden or 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: Generate and Deploy | |
on: | |
push: | |
branches: [master] | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
generate: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
cache: 'pnpm' | |
- name: Use node_modules cache | |
uses: actions/cache@v4 | |
id: pnpm-cache | |
with: | |
path: | | |
node_modules | |
key: pnpm-${{ hashFiles('package.json') }}-${{ hashFiles('pnpm-lock.yaml') }} | |
- name: pnpm install | |
run: pnpm install | |
if: steps.pnpm-cache.outputs.cache-hit != 'true' | |
- name: Fetch data | |
env: | |
COINMARKETCAP_API_KEY: ${{ secrets.COINMARKETCAP_API_KEY }} | |
RUNTIME_TARGET: ${{ inputs.target }} | |
run: | | |
pnpm run fetch-data | |
- name: Get Package Version | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@master | |
- name: Tag Package Version | |
run: git tag v${{ steps.package-version.outputs.current-version }} | |
- name: Create Release Package | |
uses: montudor/action-zip@v1 | |
with: | |
args: zip -qq -r v${{ steps.package-version.outputs.current-version }}.zip output | |
- name: Upload Latest Release | |
uses: actions/upload-artifact@v4 | |
with: | |
name: v${{ steps.package-version.outputs.current-version }}.zip | |
path: v${{ steps.package-version.outputs.current-version }}.zip | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: v${{ steps.package-version.outputs.current-version }}.zip | |
asset_name: v${{ steps.package-version.outputs.current-version }}.zip | |
tag: v${{ steps.package-version.outputs.current-version }} | |
overwrite: true | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./output | |
keep_files: true | |
cname: dsearch.mask.r2d2.to |