Skip to content

Logic to build and push docker image #5

Logic to build and push docker image

Logic to build and push docker image #5

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
convert_to_lowercase:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Convert repository name to lowercase
id: lowercase
run: echo "lowercase_repo=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Use the lowercase repository name
run: echo "The lowercase repository name is ${{ env.lowercase_repo }}"
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PAT_PACKAGE_TOKEN }}
- name: Build Image
run: docker build -t ghcr.io/${{ env.lowercase_repo }}:latest .
- name: Push Image
run: docker push ghcr.io/${{ env.lowercase_repo }}:latest