create pipiline dockerfile
This commit is contained in:
@@ -7,19 +7,20 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v5 # Updated to v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: "latest"
|
||||
tags: ${{ github.repository }}:latest
|
||||
|
||||
- name: Run container
|
||||
uses: docker/run-action@v2
|
||||
with:
|
||||
image: ${{ github.repository }}:latest
|
||||
ports: ["8000:8000"]
|
||||
run: |
|
||||
docker run -d -p 8000:8000 ${{ github.repository }}:latest
|
||||
Reference in New Issue
Block a user