Skip to content

test github actions

test github actions #1

Workflow file for this run

env:
REGISTRY: ghcr.io/anthropics/anthropic-quickstarts
name: build
on:
pull_request:
paths:
- test/**
push:
branches:
- main
paths:
- test/**
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working_directory: test

Check failure on line 18 in .github/workflows/build.yaml

View workflow run for this annotation

GitHub Actions / build

Invalid workflow file

The workflow is not valid. .github/workflows/build.yaml (Line: 18, Col: 9): Unexpected value 'working_directory'
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set image tag
run: |
short_sha=$(git rev-parse --short ${{ github.sha }})
echo "TAG=${REGISTRY}:test-${short_sha}" >> "$GITHUB_ENV"
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ env.TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
- name: Determine push tags
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "PUSH_TAGS=${TAG}" >> "$GITHUB_ENV"
else
echo "PUSH_TAGS=${TAG},${REGISTRY}:test-latest" >> "$GITHUB_ENV"
fi
- name: Push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ env.PUSH_TAGS }}