Skip to content

Docker Image Build And Deploy #7

Docker Image Build And Deploy

Docker Image Build And Deploy #7

Workflow file for this run

name: Docker Image Build And Deploy
on:
workflow_dispatch:
jobs:
docker:
env:
IMAGE_NAME: 'fujikomalan/flask-github'
runs-on: self-hosted
steps:
- name: Checking Docker Installation
run: |
docker version
- name: Checkout Repository
uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker Image
run: |
docker build -t ${{env.IMAGE_NAME}}:latest -t ${{env.IMAGE_NAME}}:$COMMIT_ID .
- name: Push Docker Image
run: |
docker push ${{env.IMAGE_NAME}}:latest
docker push ${{env.IMAGE_NAME}}:$COMMIT_ID
- name: Running Docker Container
run: |
docker container run -d --name flaskapp -p 8080:5000 ${{env.IMAGE_NAME}}:latest