|
53 | 53 | run: | |
54 | 54 | vendor/bin/psalm |
55 | 55 | vendor/bin/phpcs |
| 56 | +
|
56 | 57 | images: |
57 | 58 | runs-on: ubuntu-latest |
58 | 59 | needs: quality |
@@ -106,3 +107,38 @@ jobs: |
106 | 107 | ghcr.io/aulasoftwarelibre/lock-httpd:${{ steps.extract_tag.outputs.tag }} |
107 | 108 | cache-from: type=local,src=/tmp/.buildx-cache |
108 | 109 | cache-to: type=local,dest=/tmp/.buildx-cache,mode=max |
| 110 | + |
| 111 | + update-manifest: |
| 112 | + runs-on: ubuntu-latest |
| 113 | + needs: images |
| 114 | + if: github.event_name == 'push' && github.repository == 'aulasoftwarelibre/lock' && (startsWith(github.ref, 'refs/heads/releases/') || startsWith(github.ref, 'refs/tags/v') ) |
| 115 | + steps: |
| 116 | + - name: Extract tag name |
| 117 | + id: extract_tag |
| 118 | + run: echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT |
| 119 | + |
| 120 | + - name: Checkout config repository (aulasoftwarelibre/charts) |
| 121 | + uses: actions/checkout@v4 |
| 122 | + with: |
| 123 | + repository: aulasoftwarelibre/charts |
| 124 | + path: charts |
| 125 | + token: ${{ secrets.CHARTS_REPO_PAT }} |
| 126 | + |
| 127 | + - name: Update image tag in manifests |
| 128 | + run: | |
| 129 | + TAG="${{ steps.extract_tag.outputs.tag }}" |
| 130 | + sed -i "s|image: ghcr.io/aulasoftwarelibre/lock-php:.*|image: ghcr.io/aulasoftwarelibre/lock-php:$TAG|g" charts/lock/php-deployment.yaml |
| 131 | + sed -i "s|image: ghcr.io/aulasoftwarelibre/lock-httpd:.*|image: ghcr.io/aulasoftwarelibre/lock-httpd:$TAG|g" charts/lock/httpd-deployment.yaml |
| 132 | +
|
| 133 | + - name: Commit and push changes |
| 134 | + run: | |
| 135 | + cd charts |
| 136 | + git config --global user.name "github-actions[bot]" |
| 137 | + git config --global user.email "github-actions[bot]@users.noreply.github.com" |
| 138 | + git add . |
| 139 | + if ! git diff --staged --quiet; then |
| 140 | + git commit -m "ci: Update lock images to tag ${{ steps.extract_tag.outputs.tag }}" |
| 141 | + git push |
| 142 | + else |
| 143 | + echo "No changes to commit. El YAML ya estaba actualizado." |
| 144 | + fi |
0 commit comments