Skip to content

Merge pull request #298 from randomairborne/dependabot/github_actions… #1147

Merge pull request #298 from randomairborne/dependabot/github_actions…

Merge pull request #298 from randomairborne/dependabot/github_actions… #1147

Workflow file for this run

name: CI
on:
push:
branches:
- prod
- main
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
check:
uses: ./.github/workflows/check.yml
build:
needs: [check]
runs-on: ${{ matrix.platform.gha-image }}
strategy:
fail-fast: false
matrix:
platform:
- docker: linux/amd64
gha-image: ubuntu-24.04
slug: x86_64
- docker: linux/arm64
gha-image: ubuntu-24.04-arm
slug: aarch64
package:
- image: ghcr.io/randomairborne/experienced-gateway
name: xpd-gateway
- image: ghcr.io/randomairborne/experienced-cleanup
name: xpd-cleanup
- image: ghcr.io/randomairborne/experienced-web
name: xpd-web
- image: ghcr.io/randomairborne/experienced-setcommands
name: xpd-setcommands
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
file: ./${{ matrix.package.name }}/Dockerfile
context: .
platforms: ${{ matrix.platform.docker }}
outputs: type=image,name=${{ matrix.package.image }},push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v6
with:
name: digests-${{ matrix.package.name }}-${{ matrix.platform.slug }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs: [build]
strategy:
fail-fast: false
matrix:
package:
- image: ghcr.io/randomairborne/experienced-gateway
name: xpd-gateway
- image: ghcr.io/randomairborne/experienced-cleanup
name: xpd-cleanup
- image: ghcr.io/randomairborne/experienced-web
name: xpd-web
- image: ghcr.io/randomairborne/experienced-setcommands
name: xpd-setcommands
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Download digests
uses: actions/download-artifact@v6
with:
path: /tmp/digests
pattern: digests-${{ matrix.package.name }}-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get docker tag
id: get_tag
run: ./ci/get-tag.sh
shell: bash
env:
GITHUB_REF: ${{ github.ref }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create --tag ${{ matrix.package.image }}:${{ steps.get_tag.outputs.tag }} --tag ${{ matrix.package.image }}:git-${{ github.sha }} $(printf '${{ matrix.package.image }}@sha256:%s ' *)
build-aio:
runs-on: ubuntu-latest
needs: [merge]
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get docker tag
id: get_tag
run: ./ci/get-tag.sh
shell: bash
env:
GITHUB_REF: ${{ github.ref }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
pull: true
context: .
file: xpd-all-in-one/Dockerfile
build-args: TAG=git-${{ github.sha }}
platforms: linux/amd64,linux/arm64
tags: ghcr.io/randomairborne/experienced:${{ steps.get_tag.outputs.tag }},ghcr.io/randomairborne/experienced:git-${{ github.sha }}