Skip to content

Commit

Permalink
build on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisns authored Nov 2, 2021
1 parent d690bf6 commit 52f3c5f
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ name: Build
on:
push:
branches:
- main
- 'main'
tags:
- 'v*'
pull_request:
branches:
- 'main'


jobs:
build:
Expand All @@ -26,14 +31,14 @@ jobs:
- uses: actions/[email protected]

- name: Login to dockerhub
if: github.ref == 'refs/heads/main'
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
username: chrisns
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub
if: github.ref == 'refs/heads/main'
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ghcr.io
Expand All @@ -51,6 +56,8 @@ jobs:
tags: |
type=sha,format=long
type=edge,branch=$repo.default_branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
Expand All @@ -66,7 +73,7 @@ jobs:
cache-to: type=gha,mode=max

- name: Create kind cluster
uses: helm/kind-action@main
uses: helm/kind-action@2a525709fd0874b75d7ae842d257981b0e0f557d
timeout-minutes: 5
with:
kubectl_version: v1.22.2
Expand Down Expand Up @@ -104,7 +111,7 @@ jobs:
run: kubectl apply -f test/GoodMixed.yaml

- name: push
if: github.ref == 'refs/heads/main'
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
context: .
Expand All @@ -120,7 +127,7 @@ jobs:
sign:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
if: github.event_name != 'pull_request'
permissions:
actions: none
checks: none
Expand Down Expand Up @@ -154,4 +161,4 @@ jobs:
run: cosign sign ${TAGS}
env:
TAGS: ${{needs.build.outputs.tags}}
COSIGN_EXPERIMENTAL: 1
COSIGN_EXPERIMENTAL: 1

0 comments on commit 52f3c5f

Please sign in to comment.