Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/on_call_build_site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,28 @@ on:
jobs:
build_site:
runs-on: ubuntu-latest
permissions:
packages: write
env:
CACHE_IMAGE: orionrobots/orionrobots-site
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Build the site with docker compose
run: |
docker compose run --build build
docker compose -f docker-compose.yml -f docker-compose.ci.yml run --build build

- name: Tarball the site
run: |
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/on_call_staging_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
jobs:
staging_test:
runs-on: ubuntu-latest
permissions:
packages: write
env:
CACHE_IMAGE: orionrobots/orionrobots-site
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
steps:
- uses: actions/checkout@v4
- name: Fetch site artifact
Expand All @@ -18,6 +24,13 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Prepare staging context
run: |
# Copy staging files into the _site directory for the docker build
Expand All @@ -42,7 +55,7 @@ jobs:
# Run BDD integration tests using docker compose
echo "## BDD Test Results" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
docker compose run test 2>&1 | tee bdd_output.txt
docker compose -f docker-compose.yml -f docker-compose.ci.yml run test 2>&1 | tee bdd_output.txt
bdd_exit_code=$?
cat bdd_output.txt >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
Expand Down
53 changes: 51 additions & 2 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,56 @@
services:
serve:
build:
cache_from:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.serve:cache
cache_to:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.serve:cache,mode=max

dist:
build:
cache_from:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.dist:cache
cache_to:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.dist:cache,mode=max

build:
build:
cache_from:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.build:cache
cache_to:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.build:cache,mode=max

staging:
build:
cache_from:
- type=gha
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.staging:cache
cache_to:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.staging:cache,mode=max

test:
build:
cache_from:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.test:cache
cache_to:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.test:cache,mode=max

shell:
build:
cache_from:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.shell:cache
cache_to:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.shell:cache,mode=max

http_serve:
build:
cache_from:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.http_serve:cache
cache_to:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.http_serve:cache,mode=max

broken_links:
build:
cache_from:
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.broken_links:cache
cache_to:
- type=gha,mode=max
- type=registry,ref=ghcr.io/orionrobots/orionrobots-site.broken_links:cache,mode=max