diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bc3d29ee..0d831587 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,6 +54,7 @@ jobs: - name: Store version run: git describe --tags --always | sed 's/^v//' > build/version.txt - name: Upload package artifacts + if: github.ref_type == 'tag' uses: actions/upload-artifact@v3 with: include-hidden-files: true @@ -63,8 +64,7 @@ jobs: deploy: needs: build runs-on: ubuntu-latest - # TODO: testing in PR - # if: github.ref == 'refs/heads/master' + if: github.ref_type == 'tag' steps: - uses: actions/checkout@v3 - name: Download package artifacts @@ -96,12 +96,15 @@ jobs: package_cloud push $repo/debian/buster build/deb-systemd/carbon-relay-ng-*.deb package_cloud push $repo/el/6 build/centos-6/carbon-relay-ng-*.el6.*.rpm package_cloud push $repo/el/7 build/centos-7/carbon-relay-ng-*.el7.*.rpm - - name: Load Docker image run: docker load -i build/carbon-relay-ng.tar + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - name: Push Docker image run: | - docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_KEY }} version=$(cat build/version.txt) docker push grafana/carbon-relay-ng:$version tag=latest @@ -109,11 +112,12 @@ jobs: docker push grafana/carbon-relay-ng:$tag github_binaries: - needs: test + if: github.ref_type == 'tag' + needs: build runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - name: Run goreleaser - # TODO: currently dry running + run: curl -sfL https://goreleaser.com/static/run | bash -s -- --clean --skip-publish --snapshot