Build this Docker image #383
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 this Docker image | |
| on: | |
| workflow_dispatch: | |
| push: | |
| schedule: | |
| - cron: '11 21 * * 0' | |
| jobs: | |
| php8: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USER }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Checkout PHP8 | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: php8 | |
| path: php8 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build and push PHP8 | |
| id: docker_build_8 | |
| uses: docker/build-push-action@v3 | |
| with: | |
| push: true | |
| tags: devopsansiblede/apache:latest | |
| no-cache: true | |
| context: ./php8/ | |
| file: ./php8/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| - name: "Push re-tagged PHP8 image" | |
| uses: "akhilerm/tag-push-action@v2.0.0" | |
| with: | |
| src: "devopsansiblede/apache:latest" | |
| dst: | | |
| devopsansiblede/apache:php8 | |
| - name: Image digest PHP8 | |
| run: echo ${{ steps.docker_build_8.outputs.digest }} | |
| - name: Last Build PHP8 | |
| run: sed -i -E "s/^[0-9]{4}-[0-9]{2}-[0-9]{2}\s+[0-9]{2}:[0-9]{2}:[0-9]{2}$/$( date +"%Y-%m-%d %T" )/" ./php8/README.md | |
| - name: Commit last built PHP8 | |
| uses: stefanzweifel/git-auto-commit-action@v4 | |
| with: | |
| commit_message: Last built | |
| commit_user_name: GitHub Actions | |
| commit_user_email: dev@macwinnie.me | |
| repository: ./php8/ | |
| php7: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USER }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Checkout PHP7 | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: php7 | |
| path: php7 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v2 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build and push PHP7 | |
| id: docker_build_7 | |
| uses: docker/build-push-action@v3 | |
| with: | |
| push: true | |
| tags: devopsansiblede/apache:php7 | |
| no-cache: true | |
| context: ./php7/ | |
| file: ./php7/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| - name: Image digest PHP7 | |
| run: echo ${{ steps.docker_build_7.outputs.digest }} | |
| - name: Last Build PHP7 | |
| run: sed -i -E "s/^[0-9]{4}-[0-9]{2}-[0-9]{2}\s+[0-9]{2}:[0-9]{2}:[0-9]{2}$/$( date +"%Y-%m-%d %T" )/" ./php7/README.md | |
| - name: Commit last built PHP7 | |
| uses: stefanzweifel/git-auto-commit-action@v4 | |
| with: | |
| commit_message: Last built | |
| commit_user_name: GitHub Actions | |
| commit_user_email: dev@macwinnie.me | |
| repository: ./php7/ | |
| ... |