Skip to content

Commit

Permalink
Merge pull request #104 from mjura/build-images
Browse files Browse the repository at this point in the history
Build container images on push
  • Loading branch information
vadorovsky authored Nov 30, 2021
2 parents 917dfaf + 2bf50a6 commit 384b8f4
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
- main
tags:
- 'v*'
pull_request:
branches:
- main

name: build container image

Expand Down Expand Up @@ -36,32 +33,12 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/heads/') }}
uses: docker/build-push-action@v2
with:
build-args: |
PROFILE=debug
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: |
ghcr.io/rancher-sandbox/lockc:latest
-
name: Retrieve pull request number
if: ${{ startsWith(github.ref, 'refs/pull/') }}
run: |
echo PR_NUMBER=$(echo $GITHUB_REF | sed -e "s|^refs/pull/||" -e "s|/merge$||")
-
name: Build and push pull request container image
if: ${{ startsWith(github.ref, 'refs/pull/') }}
uses: docker/build-push-action@v2
with:
build-args:
PROFILE=debug
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: |
ghcr.io/rancher-sandbox/lockc:pr${{ env.PR_NUMBER }}
-
name: Retrieve tag name
if: ${{ startsWith(github.ref, 'refs/tags/') }}
Expand All @@ -72,8 +49,6 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: docker/build-push-action@v2
with:
build-args: |
PROFILE=release
context: .
file: ./Dockerfile
platforms: linux/amd64
Expand Down

0 comments on commit 384b8f4

Please sign in to comment.