forked from newrelic/nri-kube-events
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from arvdias/fork/main
adias/fix-pr-comments
- Loading branch information
Showing
4 changed files
with
76 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: | ||
# works for building pre-releases | ||
- published | ||
# works for releases and changing from pre-release to release | ||
- released | ||
|
||
env: | ||
|
||
DOCKER_IMAGE_NAME: newrelic/nri-kube-events | ||
RELEASE_VERSION: ${{ github.event.release.tag_name }} | ||
S3_PATH: s3://nr-downloads-main/infrastructure_agent | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Extract version from release tag | ||
run: | | ||
RELEASE_VERSION=$(echo $RELEASE_VERSION | grep -oE '([0-9.]*[0-9])$') | ||
echo "RELEASE_VERSION=$RELEASE_VERSION">> $GITHUB_ENV | ||
echo "DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME:$RELEASE_VERSION" >> $GITHUB_ENV | ||
- name: Test for prerelase | ||
if: ${{ github.event.release.prerelease }} | ||
run: | | ||
echo "DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME-pre" >> $GITHUB_ENV | ||
echo "S3_PATH=$S3_PATH/test" >> $GITHUB_ENV | ||
# - name: Login to DockerHub | ||
# uses: docker/login-action@v1 | ||
# with: | ||
# username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
# password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and push | ||
env: | ||
PRERELEASE: ${{ github.event.release.prerelease }} | ||
run: | | ||
make docker-build | ||
docker push $DOCKER_IMAGE_NAME | ||
# if this is a pre-release do not push 'latest' | ||
if [[ "false" eq "${{ github.event.release.prerelease }}" ]]; then | ||
docker tag $DOCKER_IMAGE_NAME $DOCKER_IMAGE_NAME:latest | ||
docker push $DOCKER_IMAGE_NAME:latest | ||
fi | ||
- uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
|
||
- name: Upload manifest to S3 | ||
run: | | ||
aws s3 cp deploy/nri-kube-events.yaml $S3_PATH/integrations/kubernetes/nri-kube-events-${{ env.RELEASE_VERSION }}.yaml" | ||
aws s3 cp deploy/nri-kube-events.yaml $S3_PATH/integrations/kubernetes/nri-kube-events-latest.yaml" |
File renamed without changes.
12 changes: 6 additions & 6 deletions
12
.github/workflows/test.yml → .github/workflows/validate.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
name: lint and test code | ||
name: Lint and test code | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
pull_request: | ||
jobs: | ||
test: | ||
name: test | ||
lint-test: | ||
name: lint and test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '^1.14.4' | ||
- name: Run unit tests | ||
- name: Lint | ||
run: make | ||
- name: Test | ||
run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters