diff --git a/.github/actions/pnpm-install/action.yml b/.github/actions/pnpm-build/action.yml similarity index 100% rename from .github/actions/pnpm-install/action.yml rename to .github/actions/pnpm-build/action.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 5ae22c3..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: "www ipfs deploy" - -on: [push] - -jobs: - cache-and-install: - runs-on: ubuntu-latest - - env: - WEB3_STORAGE_TOKEN: ${{ secrets.WEB3_STORAGE_TOKEN }} - - steps: - - uses: actions/checkout@v3 - - - name: Set up Node.js 18.x - uses: actions/setup-node@v3 - with: - node-version: 18.x - - - uses: ./.github/actions/pnpm-install - - # - uses: pnpm/action-setup@v2 - # name: Install pnpm - # id: pnpm-install - # with: - # version: 7 - # run_install: false - - # - name: Get pnpm store directory - # id: pnpm-cache - # shell: bash - # run: | - # echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - # - uses: actions/cache@v3 - # name: Setup pnpm cache - # with: - # path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - # key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - # restore-keys: | - # ${{ runner.os }}-pnpm-store- - - # - name: Install dependencies - # run: pnpm install - - uses: web3-storage/add-to-web3@v2 - id: web3 - with: - web3_token: ${{ secrets.WEB3_STORAGE_TOKEN }} - path_to_add: "out" - - run: echo ${{ steps.web3.outputs.cid }} - - run: echo ${{ steps.web3.outputs.url }} diff --git a/.github/workflows/w3-deploy.yml b/.github/workflows/w3-deploy.yml new file mode 100644 index 0000000..5670ea8 --- /dev/null +++ b/.github/workflows/w3-deploy.yml @@ -0,0 +1,34 @@ +name: "build and deploy on ipfs via web3.storage" + +on: + push: + branches: + - main + +jobs: + w3-deploy: + runs-on: ubuntu-latest + + env: + WEB3_STORAGE_TOKEN: ${{ secrets.WEB3_STORAGE_TOKEN }} + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 18.x + + - name: 🔧 pnpm build + uses: ./.github/actions/pnpm-build + with: + enable-corepack: true + + - name: 🔥 upload to web3 + uses: web3-storage/add-to-web3@v2 + id: web3 + with: + web3_token: ${{ secrets.WEB3_STORAGE_TOKEN }} + path_to_add: "out" + - run: echo ${{ steps.web3.outputs.cid }} + - run: echo ${{ steps.web3.outputs.url }}