Build this Docker image #58
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 this Docker image | |
on: | |
workflow_dispatch: | |
push: | |
schedule: | |
- cron: '33 1 * * 2' | |
jobs: | |
main: | |
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 Git repo | |
uses: actions/checkout@v3 | |
with: | |
ref: master | |
path: git | |
- 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 | |
id: docker_build | |
uses: docker/build-push-action@v3 | |
with: | |
push: true | |
tags: devopsansiblede/passcard:latest | |
no-cache: true | |
context: ./git/ | |
file: ./git/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
- name: Last Built | |
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" )/" ./git/README.md | |
- name: Commit last built information | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Last built | |
commit_user_name: GitHub Actions | |
commit_user_email: [email protected] | |
repository: ./git/ | |
... |