|
| 1 | +name: Filestash |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read # to fetch code (actions/checkout) |
| 10 | + |
| 11 | +jobs: |
| 12 | + update: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + environment: filestash |
| 15 | + env: |
| 16 | + NODE_VERSION: 20.x |
| 17 | + name: Update Filestash |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 21 | + |
| 22 | + - name: Use Node.js ${{ env.NODE_VERSION }} |
| 23 | + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 |
| 24 | + with: |
| 25 | + node-version: ${{ env.NODE_VERSION }} |
| 26 | + |
| 27 | + - name: Cache |
| 28 | + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 |
| 29 | + with: |
| 30 | + path: ~/.npm |
| 31 | + key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }} |
| 32 | + restore-keys: | |
| 33 | + ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock- |
| 34 | +
|
| 35 | + - name: Install dependencies |
| 36 | + run: npm install |
| 37 | + |
| 38 | + - name: Build |
| 39 | + run: npm run build:all |
| 40 | + |
| 41 | + - name: Set up SSH |
| 42 | + run: | |
| 43 | + install --directory ~/.ssh --mode 700 |
| 44 | + base64 --decode <<< "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 |
| 45 | + chmod 600 ~/.ssh/id_ed25519 |
| 46 | + ssh-keyscan -t ed25519 -H "${{ secrets.FILESTASH_SERVER }}" >> ~/.ssh/known_hosts |
| 47 | +
|
| 48 | + - name: Upload to Filestash |
| 49 | + run: | |
| 50 | + rsync dist/jquery.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.js |
| 51 | + rsync dist/jquery.min.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.min.js |
| 52 | + rsync dist/jquery.min.map filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.min.map |
| 53 | +
|
| 54 | + rsync dist/jquery.slim.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.slim.js |
| 55 | + rsync dist/jquery.slim.min.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.slim.min.js |
| 56 | + rsync dist/jquery.slim.min.map filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.slim.min.map |
| 57 | +
|
| 58 | + rsync dist-module/jquery.module.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.module.js |
| 59 | + rsync dist-module/jquery.module.min.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.module.min.js |
| 60 | + rsync dist-module/jquery.module.min.map filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.module.min.map |
| 61 | +
|
| 62 | + rsync dist-module/jquery.slim.module.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.slim.module.js |
| 63 | + rsync dist-module/jquery.slim.module.min.js filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.slim.module.min.js |
| 64 | + rsync dist-module/jquery.slim.module.min.map filestash@"${{ secrets.FILESTASH_SERVER }}":jquery-git.slim.module.min.map |
0 commit comments