Repository navigation
[gh] update #31
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: Prod Release | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| jobs: | |
| gh-page: | |
| if: contains(github.event.head_commit.message, '[gh]') || contains(github.event.head_commit.message, '[all]') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node.js 20 | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: "20.18.1" | |
| - name: Set pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 8 | |
| - name: Install dependencies & build | |
| run: | | |
| pnpm install --frozen-lockfile | |
| pnpm build | |
| - name: Deploy 🚀 | |
| uses: JamesIves/github-pages-deploy-action@4.1.5 | |
| with: | |
| branch: gh-pages # The branch the action should deploy to. | |
| folder: out # The folder the action should deploy. | |
| target-folder: docs # The folder the action deploy to. | |
| docker: | |
| if: contains(github.event.head_commit.message, '[docker]') || contains(github.event.head_commit.message, '[all]') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v1 | |
| - uses: actions/setup-node@v1 | |
| with: | |
| node-version: "20" | |
| always-auth: true | |
| registry-url: https://registry.npmjs.org | |
| - name: Set pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 8 | |
| - name: Install dependencies & build | |
| env: | |
| NEXT_PUBLIC_ENV: "staging" | |
| run: | | |
| pnpm install --frozen-lockfile | |
| pnpm build | |
| - name: Build and push docker | |
| run: | | |
| docker build -t crustio/crust-files:latest . | |
| docker login -u ${{ secrets.DOCKER_HUB_USER_NAME }} -p ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| docker push crustio/crust-files:latest | |
| - name: Upgrade crust files website | |
| uses: fifsky/ssh-action@master | |
| with: | |
| command: | | |
| sudo docker pull crustio/crust-files:latest | |
| cd /opt/compose | |
| sudo docker tag crustio/crust-files:latest crust-files | |
| sudo docker-compose up -d crust-files | |
| host: ${{ secrets.SSH_HOST }} | |
| user: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| ipfs-deploy: | |
| if: ${{ startsWith(github.ref, 'v') && (contains(github.event.head_commit.message, '[ipfs]') || contains(github.event.head_commit.message, '[all]')) }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node.js 20 | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: "20.18.1" | |
| - name: Set pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 8 | |
| - name: Install dependencies & build | |
| env: | |
| NEXT_PUBLIC_ENV: "staging" | |
| run: | | |
| pnpm install --frozen-lockfile | |
| pnpm build | |
| - name: Pin to IPFS | |
| id: upload | |
| uses: crustio/ipfs-upload-action@v2.0.5 | |
| with: | |
| path: "./out" | |
| seeds: ${{ secrets.CRUST_SEEDS }} | |
| gateway: "https://gw.crustfiles.net" | |
| params: "cid-version=1" | |
| - name: Place storage order on Crust | |
| uses: crustio/ipfs-crust-action@v2.0.8 | |
| continue-on-error: true | |
| timeout-minutes: 2 | |
| with: | |
| cid: ${{ steps.upload.outputs.hash }} | |
| seeds: ${{ secrets.CRUST_SEEDS }} | |
| - name: Create a release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: ${{ github.ref }} | |
| body: | | |
| IPFS CIDV1: ${{ steps.upload.outputs.hash }} | |
| IPFS gateways: | |
| https://${{steps.upload.outputs.hash}}.ipfs.dweb.link/ | |
| https://${{steps.upload.outputs.hash}}.ipfs.cf-ipfs.com/ | |
| https://crustfiles-xyz.ipns.dweb.link/ | |
| https://crustfiles-com.ipns.dweb.link/ |