Skip to content

fix(ci): master branch condition to push image #61

fix(ci): master branch condition to push image

fix(ci): master branch condition to push image #61

Workflow file for this run

name: Docker Image CI
on:
push:
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --tag ghcr.io/eol-uchile/portal-eol:${GITHUB_SHA}
- name: Login to GitHub Container Registry
if: ${{ github.ref == 'refs/heads/master' }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to Github Container Registry
if: ${{ github.ref == 'refs/heads/master' }}
run: |
docker push ghcr.io/eol-uchile/portal-eol:${GITHUB_SHA}