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 6af33ea
Show file tree
Hide file tree
Showing 3 changed files with 48 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
30 changes: 30 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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
run: echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

# 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/aitorastorga/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 6af33ea

Please sign in to comment.