Skip to content

Update Dockerfile

Update Dockerfile #3

Workflow file for this run

name: Build Docker Image and CodeQL Analysis on Tag Push
on:
push:
tags:
- '*'
jobs:
build-docker-image:
runs-on: ubuntu-latest
env:
ENVIRONMENT: production
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker
uses: docker/setup-buildx-action@v1
- name: Get repository name
id: repo_name
run: echo "::set-output name=repo_name::$(basename $GITHUB_REPOSITORY)"
- name: Build Docker image
run: |
docker build -t ${{ steps.repo_name.outputs.repo_name }}:${{ github.ref_name }} .
working-directory: .
- name: Log in to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Push Docker image
run: |
docker tag ${{ steps.repo_name.outputs.repo_name }}:${{ github.ref_name }} ${{ secrets.DOCKER_USERNAME }}/${{ steps.repo_name.outputs.repo_name }}:${{ github.ref_name }}
docker push ${{ secrets.DOCKER_USERNAME}}/${{ steps.repo_name.outputs.repo_name }}:${{ github.ref_name }}