docker-getting-started/.github/workflows/build.yml
eric Liu b9719cbad0
Some checks failed
Build and Push Docker Image / build (push) Failing after 3s
Update .github/workflows/build.yml
2024-06-13 05:25:20 +00:00

28 lines
769 B
YAML

name: Build and Push Docker Image
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
env:
IMAGE_NAME: ${{ github.repository_owner }}/${{ github.event.repository.name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.TOKEN }}
- name: Log in to the Docker registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login ${{ secrets.DOCKER_REGISTRY }} -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Build the Docker image
run: docker build -t ${{ secrets.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest .
- name: Push the Docker image
run: docker push ${{ secrets.DOCKER_REGISTRY }}/${{ env.IMAGE_NAME }}:latest