From 46903a0ed9e56aadccd3dafb62c30121d37a9273 Mon Sep 17 00:00:00 2001 From: Chris Burr Date: Wed, 25 Oct 2023 10:25:09 +0200 Subject: [PATCH] Build containers in CI --- .github/dependabot.yml | 7 +++++++ .github/workflows/main.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/main.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..6fddca0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..d79baee --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,36 @@ +name: containerised + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + server-base: + strategy: + matrix: + image-name: ["server-base", "secret-generation"] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: ${{ matrix.image-name }} + push: ${{ github.event_name == 'push' && github.repository == 'DIRACGrid/container-images' && github.ref_name == 'main' }} + tags: ghcr.io/diracgrid/diracx/${{ matrix.image-name }}:latest + platforms: linux/amd64,linux/arm64