Modified pt4 #76
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
merge_group: | |
types: [checks_requested] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@main | |
- name: Check out the PR branch | |
if: github.event_name == 'pull_request' | |
run: | | |
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} | |
git checkout pr-${{ github.event.pull_request.number }} | |
- name: Build the Docker image and Push to Github Container Registry | |
run: | | |
docker build . --file ./Dockerfile --tag ghcr.io/eol-uchile/docs-eol:${GITHUB_SHA} | |
docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} | |
docker push ghcr.io/eol-uchile/docs-eol:${GITHUB_SHA} |