Skip to content

Action to push image to dockerhub #8

Action to push image to dockerhub

Action to push image to dockerhub #8

Workflow file for this run

name: Docker
on:
push:
tags:
- '*'
env:
IMAGE_PATH: formio/uswds-viewer
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up SSH key
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Create image
run: docker build --no-cache -t $IMAGE_PATH .
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Push image to dockerhub
run: |
docker tag $IMAGE_PATH $IMAGE_PATH:${{ github.ref_name }}
docker push $IMAGE_PATH:${{ github.ref_name }}