-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add actions workflow * Update secrets for Docker push
- Loading branch information
1 parent
837d51e
commit d2d01f0
Showing
2 changed files
with
60 additions
and
7 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,60 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- master | ||
create: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+*' | ||
|
||
env: | ||
DOCKER_BUILDKIT: 1 | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build Artifacts | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
- name: Unit Tests | ||
run: make test | ||
- name: Build Prometheus-Exporter | ||
run: make nginx-prometheus-exporter | ||
- name: Build Image | ||
uses: docker/build-push-action@v1 | ||
with: | ||
repository: nginx/nginx-prometheus-exporter | ||
dockerfile: build/Dockerfile | ||
path: '.' | ||
tag_with_sha: true | ||
push: false | ||
|
||
publish: | ||
name: Publish Artifacts | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: github.event_name == 'create' && contains(github.ref, 'refs/tags/') | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
- name: Retrieve Tag | ||
id: get_version | ||
run: echo ::set-output name=GIT_TAG::$(echo ${GITHUB_REF/refs\/tags\//} | tr -d v) | ||
- name: Push Image | ||
uses: docker/build-push-action@v1 | ||
with: | ||
repository: nginx/nginx-prometheus-exporter | ||
dockerfile: build/Dockerfile | ||
path: '.' | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
registry: ${{ secrets.DOCKER_REGISTRY }} | ||
tag_with_ref: false | ||
tags: latest, ${{ steps.get_version.outputs.GIT_TAG }} | ||
push: true |
This file was deleted.
Oops, something went wrong.