Skip to content

Only use a single file for GitHub Actions workflow #14

Only use a single file for GitHub Actions workflow

Only use a single file for GitHub Actions workflow #14

Workflow file for this run

---
name: build and push
on:
push:
branches:
- 'main'
schedule:
- cron: '0 11 * * 2'
pull_request:
branches:
- 'main'
jobs:
docker:
name: build and push ${{ matrix.pyver }}
runs-on: ubuntu-latest
strategy:
matrix:
pyver:
- py37
- py38
- py39
- py310
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Gather metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
shivupa/cclib-ci
flavor: |
latest=true
tags: |
type=schedule,pattern={{date 'YYYYMMDD'}},prefix=${{ matrix.pyver }}-
type=sha,prefix=${{ matrix.pyver }}-
type=edge,prefix=${{ matrix.pyver }}-
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build and export to Docker
uses: docker/build-push-action@v4
with:
context: ${{ matrix.pyver }}
push: false
load: true
tags: ${{ steps.meta.outputs.tags }}
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
when: ${{ github.event_name != 'pull_request'}}

Check failure on line 62 in .github/workflows/build_and_push.yaml

View workflow run for this annotation

GitHub Actions / build and push

Invalid workflow file

The workflow is not valid. .github/workflows/build_and_push.yaml (Line: 62, Col: 9): Unexpected value 'when'
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: ${{ matrix.pyver }}
push: ${{ github.event_name != 'pull_request'}}
tags: ${{ steps.meta.outputs.tags }}