From 6c602b45ed342f823a957f3fc6a35e27c95afb2b Mon Sep 17 00:00:00 2001 From: Knappek Date: Wed, 4 Aug 2021 15:45:09 +0200 Subject: [PATCH] create release workflow --- ...=> build-and-push-latest-docker-image.yml} | 8 ++-- .github/workflows/release.yml | 40 +++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) rename .github/workflows/{build-and-push-docker-image.yml => build-and-push-latest-docker-image.yml} (80%) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build-and-push-docker-image.yml b/.github/workflows/build-and-push-latest-docker-image.yml similarity index 80% rename from .github/workflows/build-and-push-docker-image.yml rename to .github/workflows/build-and-push-latest-docker-image.yml index 5de0de2..13e0df3 100644 --- a/.github/workflows/build-and-push-docker-image.yml +++ b/.github/workflows/build-and-push-latest-docker-image.yml @@ -1,9 +1,9 @@ -name: build-and-push +name: build-and-push-latest-docker-image on: push: branches: - - 'master' + - "master" jobs: docker: @@ -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 }} @@ -30,4 +30,4 @@ jobs: with: context: exporter-go push: true - tags: knappek/opa-scorecard:latest \ No newline at end of file + tags: mcelep/opa_scorecard_exporter:latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..73edc53 --- /dev/null +++ b/.github/workflows/release.yml @@ -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