misp-docker/.github/workflows/test-build-latest.yml

32 lines
990 B
YAML
Raw Normal View History

name: Build the Docker images
on:
# Only trigger the workflow when there is a PR on the master branch
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU (for ARM emulation)
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
2023-05-18 11:50:13 +02:00
- name: Build the Docker images
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
2023-05-18 11:50:13 +02:00
# Initialize variables
DOCKER_IMG_TAG=`echo "${{ github.sha }}" | cut -c 1-7`
# Create the environment
2023-09-15 13:20:19 +02:00
sed -e '/^[[:space:]]*$/d' -e '/[#@]/d' -e 's/\"//g' -e 's/\(^[^=]*\)=\(.*\)/\1="\2"/' template.env > env.hcl
2023-05-18 11:50:13 +02:00
# Build and Push
DOCKER_IMG_TAG=$DOCKER_IMG_TAG DOCKER_USERNAME=local docker buildx bake -f docker-bake.hcl -f env.hcl