fleet/.github/workflows/push-osquery-perf-to-ecr.yml
Guillaume Ross 62d3b9145f
4620 pin action dependencies (#4622)
* Update build-binaries.yaml

Pin action versions + add read only token to build-binaries.yaml

* Update codeql-analysis.yml

Pin dependencies with hash for codeql-analysis.yml

* Update deploy-fleet-website.yml

Pin dependencies in deploy-fleet-website.yml

* Update docs.yml

Pin dependencies for docs.yml

* Update fleet-and-orbit.yml

Pinning dependencies for fleet-and-orbit.yml

* Update generate-osqueryd-app-tar-gz.yml

Pin dependencies for generate-osqueryd-app-tar-gz.yml

* Pin dependencies in goreleaser workflows

Pinned dependencies in the 3 goreleaser workflows

* Update integration.yml

Pinned dependencies with hash

* Update pr-helm.yaml

Pinned dependencies with hash

* Update push-osquery-perf-to-ecr.yml

Pinned dependencies with a hash

* Update release-helm.yaml

Pinned one dependency with a hash

* Update semgrep-analysis.yml

Pinned dependencies with hashes

* Update test-go.yaml

Pinned dependencies with hash

* Update test-packaging.yml

Pinned dependencies with hashes

* Update test-website.yml

Pinned dependencies with hashes

* Update test.yml

Pinned dependencies with hashes
2022-03-16 15:42:28 -04:00

46 lines
1.6 KiB
YAML

name: Build docker image and publish to ECR
on:
workflow_dispatch:
inputs:
enroll_secret:
description: 'Enroll Secret'
required: true
url:
description: 'Fleet server URL'
required: true
host_count:
description: 'Amount of hosts to emulate'
required: true
default: 20
tag:
description: 'docker image tag'
required: true
default: latest
jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5 # v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@05b148adc31e091bafbaf404f745055d4d3bc9d2 # v1
with:
aws-access-key-id: ${{ secrets.LOADTEST_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.LOADTEST_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@aaf69d68aa3fb14c1d5a6be9ac61fe15b48453a2 # v1
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: osquery-perf
IMAGE_TAG: ${{ github.event.inputs.tag }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG --build-arg ENROLL_SECRET=${{ github.event.inputs.enroll_secret }} --build-arg HOST_COUNT=${{ github.event.inputs.host_count }} --build-arg SERVER_URL=${{ github.event.inputs.url }} -f Dockerfile.osquery-perf .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG