Skip to content

Commit

Permalink
Update LaTeX Dev Container (#9)
Browse files Browse the repository at this point in the history
* feat(latex): revamp LaTeX devcontainer, setup docker bake

Signed-off-by: John Muchovej <[email protected]>

* test(latex): add tests for latex devcontainer

Signed-off-by: John Muchovej <[email protected]>

* feat(latex): update devcontainer template to prompt image selection

Signed-off-by: John Muchovej <[email protected]>

---------

Signed-off-by: John Muchovej <[email protected]>
Co-authored-by: John Muchovej <[email protected]>
  • Loading branch information
jmuchovej and jmuchovej authored Aug 19, 2024
1 parent a188791 commit 862a4e1
Show file tree
Hide file tree
Showing 13 changed files with 455 additions and 543 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/build-latex-devcontainer.yaml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/containers-latex.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Build and publish LaTeX devcontainer to ghcr.io"

on:
push:
paths:
- "templates/src/latex/Dockerfile"
- "templates/src/latex/docker-bake.hcl"
- ".github/workflows/build-latex-devcontainer.yaml"
workflow_dispatch:
schedule:
- cron: "0 2 1 4 *" # historically, TeXLive has been published around March

jobs:
build-push-latex:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: "Checkout repository"
uses: "actions/checkout@v4"

- name: "Setup QEMU"
uses: "docker/setup-qemu-action@v3"

- name: "Setup Docker `buildx`"
uses: "docker/setup-buildx-action@v3"

- name: "Login to `ghcr.io`"
uses: "docker/login-action@v3"
with:
registry: "ghcr.io"
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"

- id: bake
uses: docker/bake-action@v5
with:
workdir: "./templates/src/latex"
push: true
48 changes: 48 additions & 0 deletions .github/workflows/templates-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

name: "Release Dev Container Templates & Generate Documentation"
on:
workflow_dispatch:

jobs:
deploy:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: "Publish Templates"
uses: devcontainers/action@v1
with:
publish-templates: "true"
base-path-to-templates: "./templates/src"
generate-docs: "true"

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create PR for Documentation
id: push-image-info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
echo "Start."
# Configure git and Push updates
git config --global user.email github-actions[bot]@users.noreply.github.com
git config --global user.name github-actions[bot]
git config pull.rebase false
branch=automated-documentation-update-$GITHUB_RUN_ID
git checkout -b $branch
message='Automated documentation update'
# Add / update and commit
git add */**/README.md
git commit -m 'Automated documentation update [skip ci]' || export NO_UPDATES=true
# Push
if [ "$NO_UPDATES" != "true" ] ; then
git push origin "$branch"
gh pr create --title "$message" --body "$message"
fi
31 changes: 31 additions & 0 deletions .github/workflows/templates-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "CI - Test Templates"
on:
pull_request:

jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
templates: ${{ steps.filter.outputs.changes }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
latex: ./templates/**/latex/**
test:
needs: [detect-changes]
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
templates: ${{ fromJSON(needs.detect-changes.outputs.templates) }}
steps:
- uses: actions/checkout@v3

- name: Smoke test for '${{ matrix.templates }}'
id: smoke_test
uses: ./.github/actions/smoke-test
with:
template: "${{ matrix.templates }}"
99 changes: 0 additions & 99 deletions latex/.devcontainer.json

This file was deleted.

Loading

0 comments on commit 862a4e1

Please sign in to comment.