Skip to content

ci: Simplify Publishing Job #6

ci: Simplify Publishing Job

ci: Simplify Publishing Job #6

Workflow file for this run

name: Introduction to CI/CD - Publishing
on:
push:
branches:
- main
workflow_dispatch:
jobs:
publishing:
name: Publish to Docker Hub
runs-on: ubuntu-22.04
env:
IMAGE_NAME: intro-to-cicd
IMAGE_TAG: 1
steps:
- name: checkout repository onto the runner
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ secrets.DOCKER_USER }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}