Skip to content

only push on main, but still build on push and pr #6

only push on main, but still build on push and pr

only push on main, but still build on push and pr #6

Workflow file for this run

name: build_packages

Check failure on line 1 in .github/workflows/build-image.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-image.yaml

Invalid workflow file

`pr` is not a valid event name
on:
push:
pr:
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
-
name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- name: Install ghrocker
run: |
pip install .
- name: Generate Dockerfile
run: |
generate_ghrocker_dockerfile
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
-
name: Build ghrocker Image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.ghrocker
load: true
push: ${{ github.ref == 'refs/heads/main' }}
tags: |
ghcr.io/tfoote/ghrocker/ghrocker:latest
ghcr.io/tfoote/ghrocker/ghrocker:${{ steps.date.outputs.date }}
cache-from: type=gha
cache-to: type=gha,mode=max