Skip to content

update README.md to enhance project description and features overview #12

update README.md to enhance project description and features overview

update README.md to enhance project description and features overview #12

Workflow file for this run

name: Docker Image Build
on:
push:
branches:
- '*'
pull_request:
branches:
- main
types: [ closed ]
env:
IMAGE_NAME: discord-bot
jobs:
auth-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
push:
needs: auth-test
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Build image
run: docker build . --file docker/Dockerfile --tag $IMAGE_NAME
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
COMMIT=$(echo "${{ github.sha }}")
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "main" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$COMMIT
docker push $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$COMMIT