Update dependencies #356
This file contains 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
# This workflow proposes updates to the dependencies that dependabot cannot | |
name: Update dependencies | |
on: | |
# Allow manual executions | |
workflow_dispatch: | |
# Run nightly | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
propose_github_release_updates: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- key: nginx | |
path: ./proxy/Dockerfile | |
repository: nginxinc/docker-nginx | |
# This repository only publishes tags, not releases | |
tags: "yes" | |
version_jsonpath: NGINX_VERSION | |
component: proxy | |
- key: gomplate | |
path: ./proxy/Dockerfile | |
repository: hairyhenderson/gomplate | |
version_jsonpath: GOMPLATE_VERSION | |
component: proxy | |
- key: helm | |
path: ./sync/Dockerfile | |
repository: helm/helm | |
version_jsonpath: HELM_VERSION | |
component: sync | |
name: ${{ matrix.key }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Check for most recent GitHub release | |
id: next | |
uses: azimuth-cloud/github-actions/github-latest-release@master | |
with: | |
repository: ${{ matrix.repository }} | |
tags: ${{ matrix.tags || 'no' }} | |
- name: Update dependency key | |
uses: azimuth-cloud/github-actions/config-update@master | |
with: | |
path: ${{ matrix.path }} | |
updates: | | |
${{ matrix.version_jsonpath }}=${{ steps.next.outputs.version }} | |
- name: Generate app token for PR | |
uses: azimuth-cloud/github-actions/generate-app-token@master | |
id: generate-app-token | |
with: | |
repository: ${{ github.repository }} | |
app-id: ${{ secrets.AUTOMATION_APP_ID }} | |
app-private-key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }} | |
- name: Propose changes via PR if required | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ steps.generate-app-token.outputs.token }} | |
commit-message: >- | |
Update ${{ matrix.key }} to ${{ steps.next.outputs.version }} | |
branch: update-dependency/${{ matrix.key }} | |
delete-branch: true | |
title: >- | |
Update ${{ matrix.key }} to ${{ steps.next.outputs.version }} | |
body: > | |
This PR was created automatically to update | |
${{ matrix.key }} to ${{ steps.next.outputs.version }}. | |
labels: | | |
automation | |
dependency-update | |
${{ matrix.component }} | |
propose_helm_chart_updates: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- key: oauth2-proxy | |
component: sync | |
path: ./sync/chart/Chart.yaml | |
chart_name_jsonpath: dependencies[0].name | |
chart_repo_jsonpath: dependencies[0].repository | |
chart_version_jsonpath: dependencies[0].version | |
name: ${{ matrix.key }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Extract repo and chart | |
id: chart-info | |
uses: azimuth-cloud/github-actions/config-extract@master | |
with: | |
path: ${{ matrix.path }} | |
outputs: | | |
repo=${{ matrix.chart_repo_jsonpath }} | |
name=${{ matrix.chart_name_jsonpath }} | |
- name: Check for updates | |
id: next | |
uses: azimuth-cloud/github-actions/helm-latest-version@master | |
with: | |
repository: ${{ steps.chart-info.outputs.repo }} | |
chart: ${{ steps.chart-info.outputs.name }} | |
- name: Update chart version | |
uses: azimuth-cloud/github-actions/config-update@master | |
with: | |
path: ${{ matrix.path }} | |
updates: | | |
${{ matrix.chart_version_jsonpath }}=${{ steps.next.outputs.version }} | |
- name: Generate app token for PR | |
uses: azimuth-cloud/github-actions/generate-app-token@master | |
id: generate-app-token | |
with: | |
repository: ${{ github.repository }} | |
app-id: ${{ secrets.AUTOMATION_APP_ID }} | |
app-private-key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }} | |
- name: Propose changes via PR if required | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ steps.generate-app-token.outputs.token }} | |
commit-message: >- | |
Update ${{ matrix.key }} to ${{ steps.next.outputs.version }} | |
branch: update-dependency/${{ matrix.key }} | |
delete-branch: true | |
title: >- | |
Update ${{ matrix.key }} to ${{ steps.next.outputs.version }} | |
body: > | |
This PR was created automatically to update | |
${{ matrix.key }} to ${{ steps.next.outputs.version }}. | |
labels: | | |
automation | |
dependency-update | |
${{ matrix.component }} |