Skip to content

Update docker-image.yml #3

Update docker-image.yml

Update docker-image.yml #3

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
# Check out the repository code
- uses: actions/checkout@v4
# Set up Docker Buildx (for advanced Docker build features)
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Log in to GHCR using Personal Access Token (PAT)
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
# Build the Docker image and tag it with the current date
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ghcr.io/${{ github.repository }}/go-qr-web:latest
# Push the Docker image to GHCR
- name: Push to GitHub Container Registry
run: docker push ghcr.io/${{ github.repository }}/go-qr-web:latest