99 # Triggers the workflow on push or pull request events but only for the prod branch
1010 push :
1111 branches :
12- - stable
12+ - to-package
1313 - main
1414 pull_request :
1515 paths :
@@ -23,27 +23,27 @@ jobs:
2323 UMAMI_USER : ${{secrets.UMAMI_USERNAME}}
2424 UMAMI_PASSWORD : ${{secrets.UMAMI_PASSWORD}}
2525 UMAMI_SITE_DOMAIN : ${{secrets.UMAMI_SITE_DOMAIN}}
26- MUST_BE_PACKAGED : ${{ github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/main ' }}
26+ MUST_BE_PACKAGED : ${{ github.ref == 'refs/heads/to-package ' }}
2727 strategy :
2828 matrix :
2929 # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
3030 node-version : [20.x]
3131 steps :
32- - name : SETUP - Checkout
33- uses : actions/checkout@v4
32+ - name : Checkout code
33+ uses : actions/checkout@v5
3434
3535 # https://github.com/pnpm/action-setup
36- - name : SETUP - Install pnpm
36+ - name : Setup pnpm
3737 uses : pnpm/action-setup@v4
3838 with :
39+ # version from package.json
3940 run_install : false
4041
41- - name : SETUP - Install Node.js ${{ matrix.node-version }}
42- uses : actions/setup-node@v4
42+ - name : Setup Node.js ${{ matrix.node-version }}
43+ uses : actions/setup-node@v5
4344 with :
4445 node-version : ${{ matrix.node-version }}
4546 cache : ' pnpm'
46- cache-dependency-path : pnpm-lock.yaml
4747
4848 - name : SETUP - Install dependencies
4949 run : |
9999 # nb: jq extracts from package.json using 'orphanBranch' as key
100100 # warn: dont target 'main' as orphan branch
101101
102- - name : PACKAGE - BUILD - autonomous package Action with deps in dist/
102+ - name : PACKAGE - BUILD - autonomous package Action with deps in dist/ and update last tag
103103 if : env.MUST_BE_PACKAGED == 'true'
104- run : ./.github/scripts/package.sh
104+ run : |
105+ ./.github/scripts/package.sh
106+ git tag -d "last-${ORPHAN_BRANCH}" || true
107+ git push origin ":refs/tags/last-${ORPHAN_BRANCH}" || true
108+ git tag "last-${ORPHAN_BRANCH}"
109+ git push origin "last-${ORPHAN_BRANCH}"
105110
106111 - name : DEPLOY package - push dist/ on target orphan branch ${{ env.ORPHAN_BRANCH }}
107112 uses : peaceiris/actions-gh-pages@v4
0 commit comments