Update Images #433
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: Update Images | |
| on: | |
| # Triggers the workflow on push or pull request events but only for the master branch | |
| push: | |
| branches: [ latest ] | |
| pull_request: | |
| branches: [ latest ] | |
| schedule: | |
| - cron: '0 0 * * *' | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: | |
| - webhook | |
| jobs: | |
| builder: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Docker Login | |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
| #- name: Set up Docker Buildx | |
| # id: buildx | |
| # uses: docker/setup-buildx-action@master | |
| # with: | |
| # install: true | |
| # driver: kubernetes | |
| - name: Setup docker | |
| run: docker buildx create --use | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v4 | |
| with: | |
| # list of Docker images to use as base name for tags | |
| images: | | |
| ghcr.io/${{ github.repository_owner }}/gha/runner | |
| # generate Docker tags based on the following events/attributes | |
| tags: | | |
| type=schedule,pattern=latest | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| - name: Build Image | |
| uses: docker/build-push-action@master | |
| env: | |
| DOCKER_BUILD_SUMMARY: false | |
| with: | |
| context: ./ | |
| file: Dockerfile | |
| push: true | |
| pull: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |