Build & Deploy container image #1880
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Deploy container image | |
on: | |
schedule: | |
- cron: '0 0 * * *' # everyday at midnight UTC | |
pull_request: | |
branches: master | |
push: | |
branches: master | |
tags: '*' | |
jobs: | |
buildx: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
base-image: [stable, edge] | |
destination-image: [nginx-fpm-alpine, fs, gcs, pdo, s3] | |
name: ${{ matrix.destination-image }} image / ${{ matrix.base-image }} release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
install: true | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
if: ${{ github.event_name != 'pull_request' && (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/')) }} | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
if: ${{ github.event_name != 'pull_request' && (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags/')) }} | |
with: | |
registry: ghcr.io | |
username: privatebin | |
password: ${{ github.token }} | |
- name: Docker Build | |
run: ./buildx.sh ${{ github.event_name }} ${{ matrix.destination-image }} ${{ matrix.base-image }} |