Skip to content

Commit

Permalink
fix(): Remove hardcoded name in GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
n0th1ng-else committed Mar 29, 2024
1 parent 72b084a commit 120f708
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ jobs:
runs-on: ubuntu-latest
name: Push docker image
timeout-minutes: 5
env:
CONTAINER_NAME: voice-to-speech-app
steps:
- name: App version
run: echo "Picked the app version ${{ inputs.sha }}"

- name: Checkout
uses: actions/checkout@v4

- uses: hmarr/debug-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -41,7 +45,7 @@ jobs:
context: .
push: true
tags: |
ghcr.io/${{ secrets.DOCKER_USERNAME }}/voice-to-text-bot/voice-to-speech-app:${{ inputs.sha }}
ghcr.io/${{ secrets.DOCKER_USERNAME }}/voice-to-text-bot/${{ env.CONTAINER_NAME }}:${{ inputs.sha }}
build-args: APP_VERSION=${{ inputs.version }}

- name: Publish to Registry and extra tag
Expand All @@ -51,8 +55,8 @@ jobs:
context: .
push: true
tags: |
ghcr.io/${{ secrets.DOCKER_USERNAME }}/voice-to-text-bot/voice-to-speech-app:${{ inputs.docker-tag }}
ghcr.io/${{ secrets.DOCKER_USERNAME }}/voice-to-text-bot/voice-to-speech-app:${{ inputs.sha }}
ghcr.io/${{ secrets.DOCKER_USERNAME }}/voice-to-text-bot/${{ env.CONTAINER_NAME }}:${{ inputs.docker-tag }}
ghcr.io/${{ secrets.DOCKER_USERNAME }}/voice-to-text-bot/${{ env.CONTAINER_NAME }}:${{ inputs.sha }}
build-args: APP_VERSION=${{ inputs.version }}

- name: Add image reference
Expand All @@ -61,8 +65,7 @@ jobs:
COMMIT_SHA: ${{ inputs.sha }}
with:
script: |
const container = 'voice-to-speech-app'
const sha = process.env.COMMIT_SHA
const { COMMIT_SHA: sha, CONTAINER_NAME: container } = process.env
const { owner, repo } = context.issue;
const target_url = `https://github.com/${owner}/${repo}/pkgs/container/${encodeURIComponent(`${repo}/${container}`)}`
const description = `${container}:${sha}`;
Expand Down

0 comments on commit 120f708

Please sign in to comment.