Skip to content

Commit

Permalink
chore(ci): build images from tags, build next nightly (#2218)
Browse files Browse the repository at this point in the history
* chore(ci): build images from tags

* chore(ci): build next image nightly instead of every push

* Update .github/workflows/next-build-image.yaml

Co-authored-by: Armel Soro <[email protected]>

---------

Co-authored-by: Nick Boldt <[email protected]>
Co-authored-by: Armel Soro <[email protected]>
  • Loading branch information
3 people authored Jan 24, 2025
1 parent 9a7353c commit fa2e216
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/next-build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Build Next Image
name: Build Next and Tag Image

on:
# workflow_dispatch so that it can be triggered manually if needed
workflow_dispatch:
schedule:
# run at 3:18 UTC every day
- cron: "18 3 * * *"
push:
branches:
- main
tags:
- '[0-9]+.[0-9]+.[0-9]+'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -50,6 +55,11 @@ jobs:
- name: Prepare
run: |
platform=${{ matrix.platform }}
ref_name=${{ github.ref_name }}
if [ "$ref_name" == "main" ]; then
ref_name="next"
fi
echo "REF_NAME=$ref_name" >> $GITHUB_ENV
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
echo "PLATFORM_ARCH=${platform#*/}" >> $GITHUB_ENV
Expand All @@ -66,8 +76,8 @@ jobs:
password: ${{ secrets.QUAY_TOKEN }}
imageName: ${{ env.REGISTRY_IMAGE }}
imageTags: |
type=raw,value=next-${{ env.PLATFORM_ARCH }}
type=raw,value=next-${{ env.SHORT_SHA }}-${{ env.PLATFORM_ARCH }}
type=raw,value=${{ env.REF_NAME }}-${{ env.PLATFORM_ARCH }}
type=raw,value=${{ env.REF_NAME }}-${{ env.SHORT_SHA }}-${{ env.PLATFORM_ARCH }}
imageLabels: quay.expires-after=14d
push: true
platform: ${{ matrix.platform }}
Expand Down Expand Up @@ -116,8 +126,8 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}
tags: |
type=raw,value=next
type=raw,value=next-${{ env.SHORT_SHA }}
type=raw,value=${{ env.REF_NAME }}
type=raw,value=${{ env.REF_NAME }}-${{ env.SHORT_SHA }}
- name: Login to Docker Hub
uses: docker/login-action@v3
Expand Down

0 comments on commit fa2e216

Please sign in to comment.