Skip to content

changed access to dockerhub #2

changed access to dockerhub

changed access to dockerhub #2

Workflow file for this run

name: Docker Image CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
name: Create image and push to registry
runs-on: ubuntu-22.04
environment: development
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Docker image
run: export VERSION=$(jq -r .version package.json) && docker build . --file Dockerfile --tag ${{ vars.DOCKERHUB_USERNAME }}/node-app:$VERSION.$GITHUB_RUN_ID
- name: Push to Docker Hub
run: export VERSION=$(jq -r .version package.json) && docker push ${{ vars.DOCKERHUB_USERNAME }}/node-app:$VERSION.$GITHUB_RUN_ID