Skip to content

Commit

Permalink
Updated CI action for Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasua committed Apr 24, 2024
1 parent 6d9cde8 commit e5e28d6
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,24 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Build the Docker image
run: |
docker build . --file Dockerfile --tag ghcr.io/eol-uchile/backup_container:${GITHUB_SHA}
- name: Login to Github Container Registry
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: |
echo "${CR_PAT}" | docker login ghcr.io -u eolito --password-stdin
docker push ghcr.io/eol-uchile/backup_container:${GITHUB_SHA}
env:
CR_PAT: ${{ secrets.CR_PAT }}
docker push ghcr.io/eol-uchile/backup_container:${GITHUB_SHA}

0 comments on commit e5e28d6

Please sign in to comment.