Build & Deploy container image #1386
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@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
with: | |
platforms: linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
install: true | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
if: (github.ref != 'refs/heads/master' && github.event_name != 'pull_request') || github.event_name == 'schedule' | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
if: (github.ref != 'refs/heads/master' && github.event_name != 'pull_request') || github.event_name == 'schedule' | |
with: | |
registry: ghcr.io | |
username: privatebin | |
password: ${{ github.token }} | |
- name: Docker Build | |
run: ./buildx.sh ${{ github.event_name }} ${{ matrix.destination-image }} ${{ matrix.base-image }} |