|
| 1 | +name: update container tags |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + |
| 6 | +jobs: |
| 7 | + update-container-tags: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v2 |
| 11 | + with: |
| 12 | + token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |
| 13 | + |
| 14 | + - name: git fetch |
| 15 | + run: | |
| 16 | + git fetch |
| 17 | +
|
| 18 | +# Github actions doesn't have much in the way of loops. Using a matrix results |
| 19 | +# in multiple separate jobs being run, which will try to overwrite one another. |
| 20 | +# Any kind of loop shaped thing would be more elegant than this. Until then, |
| 21 | +# when a container is added copy one of these and change then name in all four |
| 22 | +# places |
| 23 | + - name: update values.yaml for renderer |
| 24 | + run: | |
| 25 | + if [[ $(git diff remotes/origin/master -- images/renderer/) ]]; then |
| 26 | + sed -i 's/tag: .* # renderer tag managed by github actions$/tag: pr-${{ github.event.number }} # renderer tag managed by github actions/' paws/values.yaml |
| 27 | + fi |
| 28 | +
|
| 29 | + - name: update values.yaml for nbserve |
| 30 | + run: | |
| 31 | + if [[ $(git diff remotes/origin/master -- images/nbserve/) ]]; then |
| 32 | + sed -i 's/tag: .* # nbserve tag managed by github actions$/tag: pr-${{ github.event.number }} # nbserve tag managed by github actions/' paws/values.yaml |
| 33 | + fi |
| 34 | +
|
| 35 | + - name: update values.yaml for paws-hub |
| 36 | + run: | |
| 37 | + if [[ $(git diff remotes/origin/master -- images/paws-hub/) ]]; then |
| 38 | + sed -i 's/tag: .* # paws-hub tag managed by github actions$/tag: pr-${{ github.event.number }} # paws-hub tag managed by github actions/' paws/values.yaml |
| 39 | + fi |
| 40 | +
|
| 41 | + - name: update values.yaml for jobber |
| 42 | + run: | |
| 43 | + if [[ $(git diff remotes/origin/master -- images/jobber/) ]]; then |
| 44 | + sed -i 's/tag: .* # jobber tag managed by github actions$/tag: pr-${{ github.event.number }} # jobber tag managed by github actions/' paws/values.yaml |
| 45 | + fi |
| 46 | +
|
| 47 | + - name: update values.yaml for singleuser |
| 48 | + run: | |
| 49 | + if [[ $(git diff remotes/origin/master -- images/singleuser/) ]]; then |
| 50 | + sed -i 's/tag: .* # singleuser tag managed by github actions$/tag: pr-${{ github.event.number }} # singleuser tag managed by github actions/' paws/values.yaml |
| 51 | + fi |
| 52 | +
|
| 53 | + - uses: EndBug/add-and-commit@v7 |
| 54 | + with: |
| 55 | + add: 'paws/values.yaml' |
| 56 | + author_name: Github Action |
| 57 | + author_email: auto@github.com |
| 58 | + branch: ${{ github.head_ref }} |
| 59 | + message: 'auto update of ${{ inputs.imagename }} tag' |
| 60 | + pull: --rebase --autostash |
0 commit comments