Skip to content

Update docker-image.yml #4

Update docker-image.yml

Update docker-image.yml #4

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Change directory to app
run: cd app && pwd && ls -al
- name: Determine version from codebase
run: |
# Example: Extract version from package.json
VERSION=$(jq -r '.version' package.json)
echo "::set-output name=version::$VERSION"
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build Docker image
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/onebox:${{ steps.determine_version.outputs.version }} .
- name: Push Docker image to Docker Hub
run: docker push ${{ secrets.DOCKER_USERNAME }}/onebox:${{ steps.determine_version.outputs.version }}