Skip to content

Commit

Permalink
ci: Adds Publish image GitHub Actions workflow.
Browse files Browse the repository at this point in the history
It publishes the code with the specified tag via a workflow dispatch.
Note that updating the package.json version and tagging the build commit is still done manually.
  • Loading branch information
KvelaGorrrrnio committed Jan 16, 2024
1 parent c78fa41 commit 0be0e36
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'Publish image'

run-name: 'Publish image of {{ github.ref_name }} as {{ inputs.versionTag }}'

on:
workflow_dispatch:
inputs:
versionTag:
description: 'Version tag (e.g. 1.2.3-staging)'
required: true
type: 'string'

env:
node-version: '16'
node-package-manager: 'yarn'

jobs:
publish-image-to-docker-hub:
name: 'Publish image to Docker Hub'
runs-on: 'ubuntu-latest'
steps:
- name: 'Retrieve repository files'
uses: 'actions/checkout@v4'

- name: 'Log in to Docker Hub'
uses: 'docker/login-action@v3'
with:
username: '${{ secrets.DOCKERHUB_USERNAME }}'
password: '${{ secrets.DOCKERHUB_PASSWORD }}'

- name: 'Build and publish Docker image'
uses: 'docker/build-push-action@v5'
with:
context: '.'
push: true
tags: |
tv2media/inews-ftp-gateway:${{ inputs.versionTag }}

0 comments on commit 0be0e36

Please sign in to comment.