Skip to content

Commit

Permalink
Merge release.yml into ci.yml for tagged release
Browse files Browse the repository at this point in the history
#15 failed to trigger releases since [workflow_run](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#workflow_run) doesn't support filtering by tags

So we try again with release as a job (rather than workflow) limited to `main` branch and tags.
  • Loading branch information
naushadh committed Aug 21, 2024
1 parent 016ee86 commit b9556d4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 30 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: Continuous Integration
on:
push:
branches: [ main ]
Expand Down Expand Up @@ -28,3 +28,24 @@ jobs:

- name: Run tests
run: make test

release:
needs: test
if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }}
name: Push to DockerHub
runs-on: ubuntu-latest
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Login to DockerHub
run: docker login -u $DOCKER_USER -p $DOCKER_PASS

- name: Release
run: ./scripts/release.sh
env:
VERSION: ${{ github.ref_name == 'main' && 'latest' || github.ref_name }}
29 changes: 0 additions & 29 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit b9556d4

Please sign in to comment.