Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use ghcr.io for images, build base on push #351

Merged
merged 1 commit into from
Feb 6, 2025
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
# ocaml compiler 4.14.1 does not have an option to build in 32 bit mode anymore.
ocaml_version: [4.14.1, 5.3.0]
container:
image: ocamlcross/windows-x64-base:${{ matrix.ocaml_version }}
image: ghcr.io/ocaml-cross/windows-x64-base:${{ matrix.ocaml_version }}
options: --user root
steps:
- name: Checkout code
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
package: ${{ fromJson(needs.collect_revdeps.outputs.revdeps) }}
ocaml_version: [4.14.1, 5.3.0]
container:
image: ocamlcross/windows-x64-base:${{ matrix.ocaml_version }}
image: ghcr.io/ocaml-cross/windows-x64-base:${{ matrix.ocaml_version }}
options: --user root
steps:
- name: Checkout code
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker image deploy

on:
push:
branches:
- main
paths:
- "packages/ocaml-windows*/**"
- ".github/workflows/docker.yml"
workflow_dispatch:


env:
BASE_IMAGE: dockcross/windows-static-x64

jobs:
docker-deploy:
strategy:
fail-fast: false
matrix:
ocaml_version: [4.14.1, 5.3.0] # synchronize with .github/workflows/ci.yml
name: Deploy ${{ matrix.ocaml_version }} image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Log in to GitHub Container Registry
uses: docker/#-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push base image
run: |
docker build -t ghcr.io/ocaml-cross/windows-x64-base:${{ matrix.ocaml_version }} -f tests/Dockerfile.base . \
--build-arg IMAGE=${{env.BASE_IMAGE}} --build-arg SYSTEM=x64 --build-arg COMPILER=${{ matrix.ocaml_version }}
docker push ghcr.io/ocaml-cross/windows-x64-base:${{ matrix.ocaml_version }}
2 changes: 1 addition & 1 deletion tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ else
IMAGE="dockcross/windows-static-x86"
fi

BASE_IMAGE="ocamlcross/windows-${SYSTEM_TYPE}-base:${OCAML_VERSION}"
BASE_IMAGE="ghcr.io/ocaml-cross/windows-${SYSTEM_TYPE}-base:${OCAML_VERSION}"

if [ -n "${BUILD_BASE}" ]; then
printf "Building ${BASE_IMAGE}.. "
Expand Down
Loading