Build & Deploy container image #2678
This file contains hidden or 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: '*' | |
| permissions: {} | |
| jobs: | |
| buildx: | |
| permissions: | |
| packages: write # for pushing ghcr images | |
| 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@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| with: | |
| platforms: linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| with: | |
| install: true | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v4 | |
| 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@v4 | |
| 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 }} |