Skip to content

Commit

Permalink
Only should publish images once and enable golangci-lint workflow f…
Browse files Browse the repository at this point in the history
…or this fork.
  • Loading branch information
jbronn committed Jun 13, 2024
1 parent fedc67b commit e6f805a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 50 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ on:
- v*
branches:
- v0.2.x
paths:
- "**/*.go"
- ".github/workflows/*.yaml"
- "go.*"
pull_request:

concurrency:
group: e2e-${{ github.head_ref || github.ref_name }}
Expand Down Expand Up @@ -178,11 +173,8 @@ jobs:
- name: Run E2E Tests EKS
run: NAMESPACE=vcluster-eks LOCAL_PORT=14553 go test -mod=vendor ./test/e2e -v

publish-latest-image:
name: Publish Latest Container Image
needs:
- e2e
- unit-test
publish-image:
name: Publish Container Image
runs-on: ubuntu-latest
steps:
- name: Checkout Code
Expand All @@ -194,6 +186,7 @@ jobs:
images: ghcr.io/radiant-maxar/cluster-api-provider-vcluster
tags: |
type=sha
type=semver,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
name: golangci-lint

on:
push:
tags:
- v*
branches:
- main
- v0.2.x
paths:
- "**/*.go"
pull_request:
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,42 +39,3 @@ jobs:
RELEASE_VERSION: ${{ steps.get_version.outputs.release_version }}
run: |
gh release upload ${RELEASE_VERSION} release/cluster-template.yaml release/infrastructure-components.yaml release/metadata.yaml --clobber
publish-images:
if: startsWith(github.ref, 'refs/tags/v') == true
runs-on: ubuntu-22.04
steps:
- name: Checkout Code
uses: actions/checkout@v4
- id: get_version
run: |
RELEASE_VERSION=$(echo $GITHUB_REF | sed -nE 's!refs/tags/!!p')
echo "::set-output name=release_version::${RELEASE_VERSION}"
- name: Get Docker Image Metadata
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/radiant-maxar/cluster-api-provider-vcluster
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Build and push release cluster-api-provider-vcluster image
id: docker_build
uses: docker/build-push-action@v5
with:
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
- name: Images digests
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit e6f805a

Please sign in to comment.