Skip to content

fix: Dockerfile to reduce vulnerabilities #50

fix: Dockerfile to reduce vulnerabilities

fix: Dockerfile to reduce vulnerabilities #50

Workflow file for this run

name: Release Docker image
on:
push:
tags:
- "*"
branches:
- "*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get Tag Version
id: version
shell: bash
run: |
if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then
echo "::set-output name=TAG_VERSION::latest"
else
echo "::set-output name=TAG_VERSION::${GITHUB_REF##*/}"
fi
- name: Extract branch name
id: extract_branch
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
- name: Log in to the container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Build and push image using tag
# uses: docker/build-push-action@v3
# with:
# context: .
# push: true
# tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.TAG_VERSION }}
- name: Build and push image using branch name
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.extract_branch.outputs.branch }}