Skip to content
Merged
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
30 changes: 13 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout whatwg/html-build
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Cache Cargo dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -43,18 +43,22 @@ jobs:
shellcheck *.sh
shellcheck ci-build/*.sh

build-and-test-image:
name: Build and Test Image
build-and-publish:
name: Build and Publish
runs-on: ubuntu-latest
needs: [static-checks]
permissions:
contents: read
packages: write
steps:
- name: Checkout whatwg/html-build
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Docker build
run: ci-build/docker-build.sh
- name: Checkout whatwg/html
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: whatwg/html
path: html
Expand All @@ -63,23 +67,15 @@ jobs:
run: |
mkdir output
bash ci-build/docker-run.sh "$GITHUB_WORKSPACE/html" output

publish:
name: Publish
runs-on: ubuntu-latest
needs: [static-checks, build-and-test-image]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
permissions:
contents: read
packages: write
steps:
- name: Docker login
uses: docker/login-action@v2
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker push
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
docker tag "$REGISTRY/$IMAGE_NAME" "$REGISTRY/$IMAGE_NAME:$GITHUB_SHA"
docker tag "$REGISTRY/$IMAGE_NAME" "$REGISTRY/$IMAGE_NAME:latest"
Expand Down
Loading