Docker build and push #38
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: Docker build and push | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
schedule: | |
- cron: 0 2 * * 0 | |
workflow_dispatch: | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- uses: hadolint/[email protected] | |
if: github.event_name == 'pull_request' | |
with: | |
dockerfile: Dockerfile | |
config: hadolint-ci.yaml | |
- name: Build images | |
run: docker buildx bake | |
- name: Log into registry | |
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' | |
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login https://index.docker.io/v1/ -u ${{ secrets.DOCKER_USER }} --password-stdin | |
- name: Push images | |
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' | |
run: docker buildx bake --push |