Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pbalogh-sa committed Aug 31, 2023
1 parent 38c7274 commit 5bee00d
Showing 1 changed file with 7 additions and 50 deletions.
57 changes: 7 additions & 50 deletions .github/workflows/reusable-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,53 +30,10 @@ jobs:

yara-rule-server:
needs: timestamp
runs-on: ubuntu-latest
steps:
- name: Checkout codeyara-rule-server
uses: actions/checkout@v3

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

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.ref }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set build output env var
if: ${{ inputs.upload == 'true' }}
run: |
echo "OUTPUTS=type=docker,dest=/tmp/yara-rule-server.tar" >> $GITHUB_ENV
- name: Build
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
tags: ghcr.io/openclarity/yara-rule-server:${{ inputs.image_tag }}
file: Dockerfile
push: ${{ inputs.push }}
outputs: "${{ env.OUTPUTS }}"
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
VERSION=${{ inputs.image_tag }}
BUILD_TIMESTAMP=${{ needs.timestamp.outputs.timestamp }}
COMMIT_HASH=${{ github.sha }}
- name: Upload artifact
if: ${{ inputs.upload == 'true' }}
uses: actions/upload-artifact@v3
with:
name: yara-rule-server
path: /tmp/yara-rule-server.tar
uses: ./.github/workflows/build-and-push-component.yaml
with:
dockerfile: Dockerfile
image_name: yara-rule-server
image_tag: ${{ inputs.image_tag }}
push: ${{ inputs.push }}
upload: ${{ inputs.upload }}

0 comments on commit 5bee00d

Please sign in to comment.