Skip to content

Commit

Permalink
Merge pull request #45 from stakater/update-pipeline
Browse files Browse the repository at this point in the history
Update pipeline
  • Loading branch information
ahmedwaleedmalik authored Nov 25, 2020
2 parents 78bd60f + 9025a38 commit a1e02af
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 16 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
DOCKER_FILE_PATH: Dockerfile
GOLANG_VERSION: 1.14
GOLANG_VERSION: 1.15.2
KUBERNETES_VERSION: "1.18.0"
KIND_VERSION: "0.7.0"

Expand Down Expand Up @@ -68,15 +68,37 @@ jobs:
tag="SNAPSHOT-PR-${{ github.event.pull_request.number }}-${sha:0:8}"
echo "##[set-output name=GIT_TAG;]$(echo ${tag})"
- name: Build and push Docker images
uses: docker/build-push-action@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.STAKATER_DOCKERHUB_USERNAME }}
password: ${{ secrets.STAKATER_DOCKERHUB_PASSWORD }}
repository: ${{ env.GITHUB_REPOSITORY }}
add_git_labels: true
dockerfile: ${{ env.DOCKER_FILE_PATH }}
tags: ${{ steps.generate_tag.outputs.GIT_TAG }}

- name: Generate image repository path
run: |
echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
pull: true
push: true
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
cache-to: type=inline
tags: |
${{ env.IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
- name: Comment on PR
uses: mshick/add-pr-comment@v1
Expand Down
37 changes: 29 additions & 8 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:

env:
DOCKER_FILE_PATH: Dockerfile
GOLANG_VERSION: 1.14
OPERATOR_SDK_VERSION: "1.0.0"
GOLANG_VERSION: 1.15.2
OPERATOR_SDK_VERSION: "1.2.0"
KUSTOMIZE_VERSION: "3.5.4"
KUBERNETES_VERSION: "1.18.0"
KIND_VERSION: "0.7.0"
Expand Down Expand Up @@ -75,16 +75,37 @@ jobs:
DEFAULT_BUMP: patch
DRY_RUN: true

- name: Build and push Docker images
uses: docker/build-push-action@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.STAKATER_DOCKERHUB_USERNAME }}
password: ${{ secrets.STAKATER_DOCKERHUB_PASSWORD }}
repository: ${{ env.GITHUB_REPOSITORY }}
add_git_labels: true
dockerfile: ${{ env.DOCKER_FILE_PATH }}
tags: ${{ steps.generate_tag.outputs.new_tag }}

- name: Generate image repository path
run: |
echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ${{ env.DOCKER_FILE_PATH }}
pull: true
push: true
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
cache-to: type=inline
tags: |
${{ env.IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.new_tag }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
org.opencontainers.image.revision=${{ github.sha }}
##############################
## Add steps to generate required artifacts for a release here(helm chart, operator manifest etc.)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- "v*"

env:
GOLANG_VERSION: 1.14
GOLANG_VERSION: 1.15.2

jobs:
build:
Expand Down

0 comments on commit a1e02af

Please sign in to comment.