Repository navigation
76 lines (74 loc) · 2.24 KB
/
Copy pathbuild.yml
File metadata and controls
76 lines (74 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build
on:
push:
branches:
- main
paths:
- "Dockerfile"
- "build.sh"
- "ddev-install.sh"
- ".github/workflows/build.yml"
schedule:
- cron: "0 1 * * 1"
workflow_dispatch:
inputs:
force_rebuild:
description: "Force rebuild and push even if the tag already exists in ghcr.io"
type: boolean
default: false
jobs:
build:
name: Build and Push Container
runs-on: ubuntu-latest
strategy:
matrix:
version: [ latest, stable ]
steps:
-
name: Checkout code
uses: actions/checkout@v7
-
name: Docker info
run: docker info
-
name: Set up QEMU
uses: docker/setup-qemu-action@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
with:
platforms: linux/amd64,linux/arm64
-
name: Setup bats and bats libs
id: setup-bats
uses: bats-core/bats-action@4.1.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
support-path: "${{ github.workspace }}/tests/bats-support"
assert-path: "${{ github.workspace }}/tests/bats-assert"
detik-path: "${{ github.workspace }}/tests/bats-detik"
file-path: "${{ github.workspace }}/tests/bats-file"
-
name: "Test ddev ${{ matrix.version }} image"
shell: 'script -q -e -c "bash -e {0}"'
env:
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./build.sh -v ${{ matrix.version }} -l
DDEV_VERSION=${{ matrix.version }} bash bats tests
-
name: Login to GitHub Packages Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: "Build ddev ${{ matrix.version }} multi-arch image"
shell: 'script -q -e -c "bash -e {0}"'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker buildx create --use --platform=linux/arm64,linux/amd64
./build.sh -v ${{ matrix.version }} -x -p ${{ inputs.force_rebuild && '-f' || '' }}