Skip to content

Commit

Permalink
if: github.ref_type == 'tag'
Browse files Browse the repository at this point in the history
  • Loading branch information
npazosmendez committed Sep 30, 2024
1 parent 8895416 commit eb04853
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -96,24 +96,28 @@ 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
[[ "$version" == *-* ]] && tag=master
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

0 comments on commit eb04853

Please sign in to comment.