|
7 | 7 |
|
8 | 8 | permissions: |
9 | 9 | contents: write # required to write to github release. |
| 10 | + packages: write |
| 11 | + actions: write |
10 | 12 |
|
11 | 13 | jobs: |
12 | 14 | release: |
|
42 | 44 | PROD_REGISTRY: "ghcr.io/nutanix-cloud-native" |
43 | 45 | GH_ORG_NAME: nutanix-cloud-native |
44 | 46 | TAG: ${{ env.RELEASE_TAG }} |
| 47 | + images: |
| 48 | + name: Push images |
| 49 | + runs-on: ubuntu-latest |
| 50 | + steps: |
| 51 | + - name: checkout code |
| 52 | + uses: actions/checkout@v5 |
| 53 | + with: |
| 54 | + fetch-depth: 0 |
| 55 | + - name: Set up Go |
| 56 | + uses: actions/setup-go@v6 |
| 57 | + with: |
| 58 | + go-version: '1.24' |
| 59 | + - name: Login to GitHub Container Registry |
| 60 | + uses: docker/login-action@v3 |
| 61 | + with: |
| 62 | + registry: ghcr.io |
| 63 | + username: ${{ github.actor }} |
| 64 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 65 | + - name: Set version info |
| 66 | + run: | |
| 67 | + echo "VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV |
| 68 | + # NB: this gets the closest tag cut from the same branch; for new minor tags, it will find the previous minor, not the previous patch release |
| 69 | + # (for example v2.7.0, not v2.7.3). For new patch releases, it should fetch the previous patch (e.g. 2.7.3, not v2.7.0) |
| 70 | + echo "PREVIOUS_VERSION=$(git describe --abbrev=0 2> /dev/null)" >> $GITHUB_ENV |
| 71 | + echo "RELEASE_BRANCH=release-$(echo ${GITHUB_REF_NAME} | grep -Eo '[0-9]\.[0-9]+')" >> $GITHUB_ENV |
| 72 | + echo "RELEASE_TAG=${GITHUB_REF_NAME}" >> $GITHUB_ENV |
| 73 | + - name: Push docker images |
| 74 | + run: | |
| 75 | + make docker-build-all |
| 76 | + make docker-push-all |
| 77 | + env: |
| 78 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 79 | + REGISTRY: "ghcr.io/nutanix-cloud-native" |
| 80 | + PROD_REGISTRY: "ghcr.io/nutanix-cloud-native" |
| 81 | + GH_ORG_NAME: nutanix-cloud-native |
| 82 | + TAG: ${{ env.RELEASE_TAG }} |
0 commit comments