Skip to content

Update docker-build-push.yml #7

Update docker-build-push.yml

Update docker-build-push.yml #7

name: Build and Push to GHCR
on:
push:
branches:
- master
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build and push Docker image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}/app
# Change tags as needed
docker build . -t $IMAGE_ID:latest
# Push the Docker image to GitHub Container Registry
docker push $IMAGE_ID:latest