Skip to content

Commit

Permalink
ci: fix image release
Browse files Browse the repository at this point in the history
Signed-off-by: Mateusz Urbanek <[email protected]>
  • Loading branch information
shanduur committed Oct 25, 2024
1 parent 6893ea0 commit df9de0b
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ permissions:
contents: write
packages: write

env:
REGISTRY: docker.io
REPOSITORY: linode
IMAGE: linode-cosi-driver

jobs:
changelog:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -44,18 +49,34 @@ jobs:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@v3
- id: buildx
uses: docker/setup-buildx-action@v3
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Capture latest tag if exists
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
with:
platforms: linux/amd64,linux/arm64
semver_only: true
with_initial_version: true
initial_version: v0.0.0
- id: tags
run: |
./scripts/tags.sh \
"${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ env.IMAGE }}" \
"${{ github.sha }}" \
"${{ github.ref_name }}" \
"${{ steps.get-latest-tag.outputs.tag }}" \
"${GITHUB_OUTPUT}"
- uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm64
push: true
tags: |
docker.io/linode/linode-cosi-driver:${{ github.ref_name }}
push: ${{ startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main') }}
load: ${{ !(startsWith(github.ref, 'refs/tags/v') || (github.ref == 'refs/heads/main')) }}
tags: ${{ steps.tags.outputs.all }}
build-args: |
VERSION=${{ steps.tags.outputs.version }}
target: runtime
- name: Scan image using Grype
id: grype
uses: anchore/scan-action@v5
with:
image: ${{ steps.tags.outputs.full_version }}
output-format: table

0 comments on commit df9de0b

Please sign in to comment.