Automated squashed import from release in private repo #1
Workflow file for this run
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: Create RDO Zip Package | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - v* | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| defaults: | |
| run: | |
| working-directory: ./src/cms | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set env | |
| run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
| - name: echo env | |
| run: echo ${{ github.workspace }}/dataprocessing-register-cms_${{ env.RELEASE_VERSION }}.tar.gz | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18" | |
| cache: "npm" | |
| registry-url: "https://npm.pkg.github.com" | |
| cache-dependency-path: "**/package-lock.json" | |
| - name: Install npm dependencies | |
| run: | | |
| echo "//npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc | |
| npm ci --ignore-scripts | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.REPO_READ_ONLY_TOKEN }} | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@master | |
| with: | |
| php-version: 8.4 | |
| - name: Composer install | |
| env: | |
| COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.REPO_READ_ONLY_TOKEN }}"}}' | |
| run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-dev | |
| - name: Run build task | |
| run: npm run build | |
| - name: Clean build | |
| run: | | |
| rm -r node_modules .git || true | |
| - name: Create version.json | |
| run: | | |
| echo "{ \"version\": \"${{ env.RELEASE_VERSION }}\", \"git_ref\": \"$GITHUB_SHA\"}" > public/version.json | |
| - name: Move static website hugo template to the app | |
| working-directory: ./src | |
| run: | | |
| cp cms/public/version.json static-website/static/version.json | |
| mv static-website/ cms/ | |
| - name: Copy .db_requirements | |
| working-directory: ./ | |
| run: cp .db_requirements ./src/cms | |
| - name: Create tar | |
| run: tar -czf ${{ github.workspace }}/dataprocessing-register-cms_${{ env.RELEASE_VERSION }}.tar.gz ./app ./bootstrap/app.php ./config ./database ./public ./resources ./routes ./vendor ./artisan ./composer.json ./static-website ./.db_requirements | |
| - name: Upload release tar | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dataprocessing-register-cms_${{ env.RELEASE_VERSION }} | |
| path: ${{ github.workspace }}/dataprocessing-register-cms_${{ env.RELEASE_VERSION }}.tar.gz | |
| retention-days: 30 | |
| if-no-files-found: error |