Skip to content

feat: abstract secret retrieval from environment into function #6

feat: abstract secret retrieval from environment into function

feat: abstract secret retrieval from environment into function #6

name: Publish Docker Image to GHCR
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and tag Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:latest .
- name: Push Docker image to GHCR
run: |
docker push ghcr.io/${{ github.repository }}:latest