Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
Update docker-image.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
litalmason authored Jan 30, 2024
1 parent ec4a261 commit db0273f
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: Deploy to GitHub Pages

on:
push:
Expand All @@ -7,13 +7,28 @@ on:
branches: [ "main" ]

jobs:
build:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2

- name: Build the Docker image
run: |
REPO_NAME=$(echo $GITHUB_REPOSITORY | tr '/' '-')
docker build ./portal --file ./portal/Dockerfile --tag $REPO_NAME:$(date +%s)
# Build your Docker image
- name: Build Docker image
run: docker build ./portal --file ./portal/Dockerfile --tag my-image

# Run the Docker container and generate static content
# This step assumes your Docker container outputs static files to /usr/share/nginx/html
# Adjust the command according to how your container serves static content
- name: Run Docker container
run: docker run --name my-container my-image

- name: Copy static content from Docker container
run: docker cp my-container:/usr/share/nginx/html ./static-content

# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./static-content

0 comments on commit db0273f

Please sign in to comment.