Skip to content

test: try fixing container action #14

test: try fixing container action

test: try fixing container action #14

name: puppeteer-container
on:
push:
branches: [ "puppeteer-container" ]
tags: [ v* ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: puppeteer
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
name: ${{ steps.step1.outputs.name }}
version: ${{ steps.step1.outputs.version }}
steps:
- id: step1
run: |
IMAGE_ID=${{ env.REGISTRY }}/${{ github.repository_owner }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "main" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
echo "name=$IMAGE_ID" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
build:
runs-on: ubuntu-latest
needs: prepare
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Workaround Windows mess and set git to keep original line endings
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- run: podman --version
- name: Build container image
run: |
podman build -t "$IMAGE_NAME" -f puppeteer.containerfile \
--label "org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \
--label "org.opencontainers.image.description=Puppeteer container" \
--label "org.opencontainers.image.licenses=MIT"
- name: List images
run: podman images
- name: Test run
run: podman run --rm --init --userns=keep-id -v $(pwd):/app -w /app $IMAGE_NAME ls -la
- name: Login in to registry
if: success()
run: echo "${{ secrets.GITHUB_TOKEN }}" | podman login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin
- name: Push container image
if: success()
run: |
IMAGE=${{ needs.prepare.outputs.name }}:${{ needs.prepare.outputs.version }}
podman tag $IMAGE_NAME $IMAGE
podman push $IMAGE
test:
runs-on: ubuntu-latest
needs: prepare
container: ${{ REGISTRY }}/${{ needs.prepare.outputs.name }}:${{ needs.prepare.outputs.version }}

Check failure on line 76 in .github/workflows/puppeteer-container.yml

View workflow run for this annotation

GitHub Actions / puppeteer-container

Invalid workflow file

The workflow is not valid. .github/workflows/puppeteer-container.yml (Line: 76, Col: 16): Unrecognized named-value: 'REGISTRY'. Located at position 1 within expression: REGISTRY
steps:
- name: Self test
run: |
echo "Chrome: " $CHROME_BIN
pwd
ls -la