diff --git a/.github/workflows/push-examples.yaml b/.github/workflows/push-examples.yaml index 8db5d70b..b3e6fd6d 100644 --- a/.github/workflows/push-examples.yaml +++ b/.github/workflows/push-examples.yaml @@ -22,8 +22,9 @@ jobs: env: dir: 'packages/examples/${{ matrix.dir }}/' - domain: '${{ matrix.dir }}.${{ vars.DOMAIN }}' archive: 'site.tar.gz' + storage_name_key: 'STORAGE_NAME_${{ matrix.dir }}' + storage_password_key: 'STORAGE_PASSWORD_${{ matrix.dir }}' runs-on: ubuntu-latest @@ -43,7 +44,7 @@ jobs: # creates archive of dir, moves content to subdir "source" - name: Create source archive run: git archive --prefix "source/" -o "${{ env.dir }}source.tar.gz" "HEAD:${{ env.dir }}" - + # Copy source archive, to allow old source path on web server. Step should get removed after new release and a bit of time - name: Duplicate source archive run: cp "${{ env.dir }}source.tar.gz" "${{ env.dir }}${{ matrix.dir }}.tar.gz" @@ -52,16 +53,13 @@ jobs: uses: ./.github/workflows/repo/build-page with: root: ${{ env.dir }} - archive: ${{ env.archive }} - - name: Prepare SSH - uses: kielabokkie/ssh-key-and-known-hosts-action@v1 + - name: BunnyCDN storage deployer + uses: ayeressian/bunnycdn-storage-deploy@v2.2.4 with: - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - ssh-host: ${{ secrets.SSH_HOST }} - - # copies built site archive to server, unpacks archive on server - - name: Push files to web server - run: | - scp "${{ env.archive }}" "${{ env.domain }}@${{ secrets.SSH_HOST }}" - ssh "${{ env.domain }}@${{ secrets.SSH_HOST }}" "tar -xf ${{ env.archive }}" + source: '${{ env.dir }}.dist/prod' + storageZoneName: '${{ secrets[env.storage_name_key] }}' + storagePassword: '${{ secrets[env.storage_password_key] }}' + upload: 'true' + remove: 'false' + purgePullZone: 'false' diff --git a/.github/workflows/push-site.yaml b/.github/workflows/push-site.yaml index 04a6f7a7..02ac9587 100644 --- a/.github/workflows/push-site.yaml +++ b/.github/workflows/push-site.yaml @@ -17,7 +17,6 @@ jobs: env: dir: 'packages/nuejs.org/' - domain: '${{ vars.DOMAIN }}' archive: 'site.tar.gz' runs-on: ubuntu-latest @@ -29,16 +28,13 @@ jobs: uses: ./.github/workflows/repo/build-page with: root: ${{ env.dir }} - archive: ${{ env.archive }} - - name: Prepare SSH - uses: kielabokkie/ssh-key-and-known-hosts-action@v1 + - name: BunnyCDN storage deployer + uses: ayeressian/bunnycdn-storage-deploy@v2.2.4 with: - ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - ssh-host: ${{ secrets.SSH_HOST }} - - # copies built site archive to server, unpacks archive on server - - name: Push files to web server - run: | - scp "${{ env.archive }}" "${{ env.domain }}@${{ secrets.SSH_HOST }}" - ssh "${{ env.domain }}@${{ secrets.SSH_HOST }}" "tar -xf ${{ env.archive }}" + source: '${{ env.dir }}.dist/prod' + storageZoneName: '${{ secrets.STORAGE_NAME_site }}' + storagePassword: '${{ secrets.STORAGE_PASSWORD_site }}' + upload: 'true' + remove: 'false' + purgePullZone: 'false' diff --git a/.github/workflows/repo/build-page/action.yaml b/.github/workflows/repo/build-page/action.yaml index a0bada06..b0a8ef04 100644 --- a/.github/workflows/repo/build-page/action.yaml +++ b/.github/workflows/repo/build-page/action.yaml @@ -4,9 +4,6 @@ inputs: root: default: '.' type: string - archive: - default: '' - type: string runs: using: composite @@ -23,9 +20,3 @@ runs: - name: Build Nue Project shell: bash run: nue build -pr "${{ inputs.root }}" - - # archive generated site, remove leading "./" from file paths in archive - - name: Archive files - if: ${{ inputs.archive }} - shell: bash - run: tar -C "${{ inputs.root }}.dist/prod" --transform "s/^\.\///" -czf "${{ inputs.archive }}" .