Skip to content

Merge pull request #4663 from HarshitaKalani/findloc_01 #2

Merge pull request #4663 from HarshitaKalani/findloc_01

Merge pull request #4663 from HarshitaKalani/findloc_01 #2

name: Create and publish a Docker image
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
REGISTRY: ghcr.io
USER: lfortran
PROJECT: lfortran
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to the Container registry
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USER }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name == 'push' }}
tags: ${{ env.REGISTRY }}/${{ env.USER }}/${{ env.PROJECT }}:latest