Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add Github Actions to use Matrix Builds #14

Closed
jasonmccallister opened this issue Dec 20, 2020 · 0 comments
Closed

Add Github Actions to use Matrix Builds #14

jasonmccallister opened this issue Dec 20, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jasonmccallister
Copy link
Contributor

Buildkit does not support subdirectories. As soon as moby/buildkit#1684 is resolved, we can use a single build.yml for all building and pushing all images:

name: Docker Build
on:
  push:
    branches:
      - stable
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        php: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0"]
    name: build - ${{ matrix.php }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      - name: Login to Docker Hub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: Build and push php-fpm:${{ matrix.php }}
        uses: docker/build-push-action@v2
        with:
          context: ${{ matrix.php }}
          file: ./${{ matrix.php }}/Dockerfile
          push: true
          tags: craftcms/php-fpm:${{ matrix.php }}
          build-args: |
            PROJECT_TYPE=fpm
            PHP_VERSION=${{ matrix.php }}
      - name: Build and push php-fpm:${{ matrix.php }}-dev
        uses: docker/build-push-action@v2
        with:
          context: ${{ matrix.php }}
          file: ./${{ matrix.php }}/dev.Dockerfile
          push: true
          tags: craftcms/php-fpm:${{ matrix.php }}-dev
          build-args: |
            PROJECT_TYPE=php-fpm
            PHP_VERSION=${{ matrix.php }}
@jasonmccallister jasonmccallister added the bug Something isn't working label Dec 20, 2020
@jasonmccallister jasonmccallister self-assigned this Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant