Skip to content

Commit

Permalink
create release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Knappek committed Aug 4, 2021
1 parent bd867d6 commit 6c602b4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: build-and-push
name: build-and-push-latest-docker-image

on:
push:
branches:
- 'master'
- "master"

jobs:
docker:
Expand All @@ -19,7 +19,7 @@ jobs:
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -30,4 +30,4 @@ jobs:
with:
context: exporter-go
push: true
tags: knappek/opa-scorecard:latest
tags: mcelep/opa_scorecard_exporter:latest
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: release

on:
push:
tags:
- "v*.*.*"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

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

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: exporter-go
push: true
tags: mcelep/opa_scorecard_exporter:${{ steps.get_version.outputs.VERSION }}

- name: Release
uses: softprops/action-gh-release@v1

0 comments on commit 6c602b4

Please sign in to comment.