GitHub actions build #2
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' | |
'on': | |
pull_request: | |
branches: | |
- 'master' | |
push: | |
branches: | |
- 'master' | |
schedule: | |
- cron: "0 1 * * 0" # Run every Sunday at 1:00 UTC | |
defaults: | |
run: | |
shell: 'bash' | |
env: | |
IMAGE_NAME: 'ghcr.io/dsiebel/shellcheck-docker:latest' | |
jobs: | |
build: | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: 'Set up Docker Buildx' | |
uses: 'docker/setup-buildx-action@v3' | |
- name: 'Build' | |
uses: 'docker/build-push-action@v6' | |
with: | |
push: ${{ github.event_name != 'pull_request' }} | |
load: ${{ github.event_name == 'pull_request' }} | |
tags: ${{ env.IMAGE_NAME}} | |
- name: 'Test' | |
run: | | |
docker run --rm ${{ env.IMAGE_NAME}} --version | |
docker run --rm ${{ env.IMAGE_NAME}} --help | |
docker run --rm ${{ env.IMAGE_NAME}} shellcheck --version | |
docker run --rm ${{ env.IMAGE_NAME}} shellcheck --help |