Add deployment workflow
Some checks failed
CI / lint (push) Successful in 11s
CI / test (push) Successful in 8s
CI / deploy (push) Failing after 5s

- Moves deployment steps into the CI workflow.
- Removes the separate deploy workflow file.
- Adds a dependency on the test job.
- Only deploys on the master branch.
- Logs into DockerHub and Gitea registries.
- Sets up Docker Buildx and builds/pushes the image.
This commit is contained in:
Roger Gonzalez 2025-05-17 14:05:15 -03:00
parent bc48d157f7
commit e81b935f33
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6
2 changed files with 24 additions and 31 deletions

View File

@ -27,6 +27,7 @@ jobs:
test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v3
@ -43,3 +44,26 @@ jobs:
- name: Upload to Codecov
run: bash <(curl -s https://codecov.io/bash)
deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Log in to DockerHub
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
- name: Log in to Gitea Registry
run: echo "${{ vars.REPOSITORY_TOKEN }}" | docker login git.rogs.me -u rogs --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push image
run: |
docker buildx build --push \
--tag rogsme/cleanmedia:latest \
--tag git.rogs.me/rogs/cleanmedia:latest \
.

View File

@ -1,31 +0,0 @@
name: Deploy to DockerHub & Gitea
on:
workflow_run:
workflows: ["CI"]
types:
- completed
jobs:
deploy:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Log in to DockerHub
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
- name: Log in to Gitea Registry
run: echo "${{ vars.REPOSITORY_TOKEN }}" | docker login git.rogs.me -u rogs --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push image
run: |
docker buildx build --push \
--tag rogsme/cleanmedia:latest \
--tag git.rogs.me/rogs/cleanmedia:latest \
.