Release library and media to artifact(dev) #346
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: Release library and media to artifact(dev) | |
| on: | |
| # push: | |
| # branches: [dev] | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| name: Release to github and artifact | |
| runs-on: ubuntu-latest | |
| env: | |
| CI: false | |
| appname: library | |
| steps: | |
| - uses: actions/checkout@v3 | |
| name: Check out code | |
| - name: Create Zip Archive for artifact | |
| run: | | |
| mkdir ${{ env.appname }} artifacts | |
| cp -r apps ${{ env.appname }} | |
| cp -r docs ${{ env.appname }} | |
| cp -r template ${{ env.appname }} | |
| cp *.md ${{ env.appname }} | |
| cp ${{ env.appname }}.json ${{ env.appname }} | |
| zip -r ${{ env.appname }}-dev.zip ${{ env.appname }} | |
| cp ${{ env.appname }}-dev.zip artifacts | |
| # - name: Upload library-dev.zip to artifacts | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: ${{ env.appname }}-dev | |
| # path: ${{ env.appname }} | |
| - name: Upload To cloudflare r2 | |
| uses: ryand56/r2-upload-action@latest | |
| with: | |
| r2-account-id: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| r2-access-key-id: ${{ secrets.CLOUDFLARE_R2_SECRET_ID }} | |
| r2-secret-access-key: ${{ secrets.CLOUDFLARE_R2_SECRET_KEY }} | |
| r2-bucket: artifact | |
| source-dir: artifacts | |
| destination-dir: ./dev/websoft9/plugin/library | |
| - name: Purge Cloudflare Cache | |
| uses: jakejarvis/cloudflare-purge-action@master | |
| env: | |
| CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE_ID }} | |
| CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| PURGE_URLS: '["https://artifact.websoft9.com/dev/websoft9/plugin/library/library-dev.zip"]' | |
| - name: Trigger websoft9/media-dev.yml workflow | |
| uses: benc-uk/workflow-dispatch@v1 | |
| with: | |
| workflow: media_dev.yml | |
| repo: websoft9/websoft9 | |
| ref: dev | |
| token: ${{secrets.MYGITHUB_ADMIN_TOKEN}} |