Skip to content

Commit

Permalink
Create docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmorley15 authored Jul 9, 2024
1 parent 843f3d7 commit 8479d9f
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Upload Docker image to GHCR

on:
push:
branches:
- main
paths:
- 'backend/**'

env:
IMAGE_NAME: "adventurelog-backend"

jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.ACCESS_TOKEN }}

- name: Build Docker image
run: docker build -t $IMAGE_NAME:latest ./backend

- name: Tag Docker image
run: docker tag $IMAGE_NAME:latest ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest

- name: Push Docker image to GHCR
run: docker push ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest

0 comments on commit 8479d9f

Please sign in to comment.