Skip to content

chore: Add helpers:pinGitHubActionDigests to renovate.json (#14) #23

chore: Add helpers:pinGitHubActionDigests to renovate.json (#14)

chore: Add helpers:pinGitHubActionDigests to renovate.json (#14) #23

Workflow file for this run

name: buildx
on:
workflow_dispatch:
# pull_request:
schedule:
- cron: '22 4 * * *'
push:
branches:
- 'master'
jobs:
buildx:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Set up variable repository name
run: echo "IMAGE_NAME=${{ github.repository }}" >> $GITHUB_ENV
- name: Initial Buildx
uses: docker/build-push-action@v5
with:
context: .
file: Containerfile
tags: ${{ env.IMAGE_NAME }}:testing
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
- name: Load Built Image and Get Variables
id: vars
run: |
docker buildx build \
-f Containerfile \
-t ${{ env.IMAGE_NAME }}:testing \
--platform=linux/amd64 \
--cache-to type=gha,mode=max \
--cache-from type=gha \
--load \
.
CID=$(docker run -d ${{ env.IMAGE_NAME }}:testing)
VER_FULL=$(docker exec $CID rpm -q --queryformat '%{VERSION}' zpa-connector)
echo "VER_FULL=$VER_FULL" >> $GITHUB_ENV
docker rm -f $CID
VER_MINOR=$(echo $VER_FULL | cut -d. -f-2)
echo "VER_MINOR=$VER_MINOR" >> $GITHUB_ENV
VER_MAJOR=$(echo $VER_FULL | cut -d. -f-1)
echo "VER_MAJOR=$VER_MAJOR" >> $GITHUB_ENV
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Buildx and Push
uses: docker/build-push-action@v5
with:
context: .
file: Containerfile
tags: |
ghcr.io/${{ env.IMAGE_NAME }}:latest
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.VER_FULL }}
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.VER_MINOR }}
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.VER_MAJOR }}
platforms: linux/amd64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false