Skip to content

Commit

Permalink
Add automatic package generation (Github Actions)
Browse files Browse the repository at this point in the history
  • Loading branch information
AitorAstorga committed Oct 2, 2024
1 parent 26632d2 commit 41964b4
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dockerfile
README.md
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: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Log in to the Container registry
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Build the Docker image
- name: Build the Docker image
run: docker build . --file Dockerfile --tag aichan-cv:latest

# Push the Docker image to GHCR
- name: Push Docker images to GHCR
run: |
# Push the main app image
docker push ghcr.io/${{ github.repository_owner }}/aichan-cv:latest
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Dockerfile
FROM nginx:latest

ENV DEBIAN_FRONTEND=noninteractive

# Remove the directory
RUN rm -rf /usr/share/nginx/html

# Copy the repository to the directory
COPY . /usr/share/nginx/html

# Expose port 80 for NGINX
EXPOSE 80

# Start NGINX
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit 41964b4

Please sign in to comment.