Bump docker/login-action from 3.0.0 to 3.2.0 #192
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
name: Docker image build | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches-ignore: | |
- 'master' | |
jobs: | |
build-latest: | |
name: Build latest Image | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64, arm64, 386] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare multiarch | |
run: sudo podman run --rm --privileged docker.io/tonistiigi/binfmt --install all | |
- name: Build latest image | |
uses: redhat-actions/[email protected] | |
with: | |
image: loki | |
archs: ${{ matrix.arch }} | |
tags: latest-${{ matrix.arch }} | |
containerfiles: | | |
./Dockerfile | |
build-args: | | |
VERSION=master | |
GOARCH=${{ matrix.arch }} | |
layers: true | |
build-version: | |
name: Build Version Image | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64, arm64, 386] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get latest Loki release | |
run: | | |
export LOKI_LATEST=$(curl -s "https://api.github.com/repos/grafana/loki/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') | |
echo "VERSION=$LOKI_LATEST" >> ${GITHUB_ENV} | |
shell: bash | |
- name: check if latest loki is already a package version | |
id: get_versions | |
uses: octokit/[email protected] | |
with: | |
route: GET /user/packages/container/loki/versions | |
env: | |
GITHUB_TOKEN: ${{ secrets.PACKAGES }} | |
- run: | | |
export LOKI_AVAIL=$(echo "${{ steps.get_versions.outputs.data }}"|grep -Po "${VERSION}"|head -1) | |
echo "AVAIL=$LOKI_AVAIL" >> ${GITHUB_ENV} | |
- name: Prepare multiarch | |
run: sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
if: env.VERSION != env.AVAIL | |
- name: Build version image | |
uses: redhat-actions/[email protected] | |
with: | |
image: loki | |
archs: ${{ matrix.arch }} | |
tags: ${{ env.VERSION }}-${{ matrix.arch }} | |
dockerfiles: | | |
./Dockerfile | |
build-args: | | |
VERSION=${{ env.VERSION }} | |
GOARCH=${{ matrix.arch }} | |
if: env.VERSION != env.AVAIL | |