Publish Docker image #219
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: Publish Docker image | |
| on: | |
| push: ~ | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| jobs: | |
| build-and-publish-image: | |
| runs-on: ubuntu-latest | |
| 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 DockerHub | |
| uses: docker/login-action@v1 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Resolve branch name | |
| id: vars | |
| run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} | |
| - | |
| name: Build and push common | |
| uses: docker/build-push-action@v2 | |
| with: | |
| file: ./common.Dockerfile | |
| push: true | |
| tags: dontdrinkandroot/php:${{ steps.vars.outputs.short_ref }}-common | |
| - | |
| name: Build and push test | |
| uses: docker/build-push-action@v2 | |
| with: | |
| file: ./test.Dockerfile | |
| push: true | |
| tags: dontdrinkandroot/php:${{ steps.vars.outputs.short_ref }}-test | |
| build-args: | | |
| FROM=dontdrinkandroot/php:${{ steps.vars.outputs.short_ref }}-common | |
| - | |
| name: Build and push symfony-dev | |
| uses: docker/build-push-action@v2 | |
| with: | |
| file: ./symfony-dev.Dockerfile | |
| push: true | |
| tags: dontdrinkandroot/php:${{ steps.vars.outputs.short_ref }}-symfony-dev | |
| build-args: | | |
| FROM=dontdrinkandroot/php:${{ steps.vars.outputs.short_ref }}-test | |
| - | |
| name: Build and push symfony-prod | |
| uses: docker/build-push-action@v2 | |
| with: | |
| file: ./symfony-prod.Dockerfile | |
| push: true | |
| tags: dontdrinkandroot/php:${{ steps.vars.outputs.short_ref }}-symfony-prod | |
| build-args: | | |
| FROM=dontdrinkandroot/php:${{ steps.vars.outputs.short_ref }}-common |