Update docker-image.yml #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Jekyll Docker CI/CD | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build the Docker image and build Jekyll site | |
run: | | |
docker build . --file Dockerfile --tag jekyll-site:latest | |
docker run --rm -v $(pwd)/_site:/srv/jekyll/_site jekyll-site:latest jekyll build | |
- name: Upload _site folder as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: site | |
path: _site | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Download site artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: site | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
folder: _site |