blog/.forgejo/workflows/build.yml
Radu C. Martin 60fbb8d189
Some checks failed
Build and publish docker image / build-site (push) Failing after 3s
Build and publish docker image / build-docker (push) Has been skipped
feat: initial commit
2025-04-04 21:36:39 +02:00

83 lines
2 KiB
YAML

name: "Build and publish docker image"
on:
push:
branches:
- main
paths-ignore:
- .gitignore
- README.md
- LICENSE
# Allow one concurrent deployment
concurrency:
group: "blog"
cancel-in-progress: true
jobs:
build-site:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# submodules: true
# If using the 'assets' git submodule from Chirpy Starter, uncomment above
# (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets)
# Build and test site
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Build site
run: bundle exec jekyll b -d _site
env:
JEKYLL_ENV: "production"
- name: Test site
run: |
bundle exec htmlproofer _site \
\-\-disable-external \
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
# Upload artifact
- name: Upload artifacts
uses: forgejo/upload-artifact@v4 # temporary fork until actions/upload-artifact supports GHES
with:
name: jekyll-chirpy-blog
path: _site
retention-days: 1
build-docker:
runs-on: ubuntu-latest
needs: build-site
steps:
# Needed so that download artifacts knows it's a local repo
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifacts
uses: forgejo/download-artifact@v4 # temporary fork until actions/download-artifact supports GHES
with:
path: _site
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Check how to push to forgejo's repo
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: user/app:latest