Added code

This commit is contained in:
Foat Akhmadeev 2024-12-16 13:11:33 +03:00
parent 0f384e4e0d
commit 1951cea3c5
4 changed files with 294 additions and 1 deletions

51
.github/workflows/verify.yml vendored Normal file
View file

@ -0,0 +1,51 @@
name: verify
on:
push:
branches:
- prime
permissions:
contents: read
packages: write
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create test Dockerfile
run: |
echo 'FROM alpine:latest
ARG MY_ENV_VAR
ARG MY_ENV_VAR2
ENV MY_ENV_VAR=$MY_ENV_VAR
ENV MY_ENV_VAR2=$MY_ENV_VAR2
CMD ["sh", "-c", "echo Result: $MY_ENV_VAR $MY_ENV_VAR2"]' > Dockerfile
cat Dockerfile
- name: Use Build and Push action
uses: ./
with:
login_registry: ghcr.io
login_username: ${{ github.actor }}
login_password: ${{ secrets.GITHUB_TOKEN }}
tags: |
ghcr.io/frozen-tapestry/podman-action-verify:latest
dockerfile: Dockerfile
build_args: |
MY_ENV_VAR=Test
MY_ENV_VAR2=Test2
security:
--security-opt seccomp=unconfined --security-opt apparmor=unconfined
push: true
- name: Run Docker container and verify output
id: verify-output
run: |
OUTPUT=$(docker run --rm ghcr.io/frozen-tapestry/podman-action-verify:latest)
echo "Container Output: $OUTPUT"
if [ "$OUTPUT" != "Result: Test Test2" ]; then
echo "Output does not match expected string"
exit 1
fi