2024-06-13 05:21:47 +00:00
|
|
|
name: Build and Push Docker Image
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-06-13 05:23:53 +00:00
|
|
|
- master
|
2024-06-13 05:21:47 +00:00
|
|
|
|
2020-08-27 08:53:21 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2024-06-13 05:21:47 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
IMAGE_NAME: ${{ github.repository_owner }}/${{ github.event.repository.name }}
|
|
|
|
|
2020-08-27 08:53:21 +00:00
|
|
|
steps:
|
2024-06-13 05:21:47 +00:00
|
|
|
- name: Checkout repository
|
2024-06-13 05:25:20 +00:00
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.TOKEN }}
|
2024-06-13 05:21:47 +00:00
|
|
|
|
|
|
|
- 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
|