Skip to content

Commit

Permalink
Change docker build action to push to GHCR
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-smith-tech authored Jan 25, 2025
1 parent 5e9896a commit a7a8e9b
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]

jobs:
build:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag portfolio:$(date +%s)

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/portfolio:latest

0 comments on commit a7a8e9b

Please sign in to comment.