Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a116302a10 | ||
|
|
459174e3c3 | ||
|
|
78421b9a93 | ||
|
|
b206c734b0 | ||
|
|
9102a9b15a | ||
|
|
3ff9759e1e | ||
|
|
dd2571c09d |
@@ -6,41 +6,41 @@ on:
|
|||||||
- '*' # Trigger on any git tag
|
- '*' # Trigger on any git tag
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
build-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: mgoltzsche/podman:5.7.1-minimal
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Install Node.js
|
||||||
|
run: |
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
|
||||||
|
apt-get update && apt-get install -y nodejs
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Podman
|
- name: Build container image
|
||||||
|
env:
|
||||||
|
REGISTRY: https://gitea.papryk.com
|
||||||
|
IMAGE_NAME: Papryk/dj-spangebob
|
||||||
|
TAG: ${{ gitea.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
export XDG_RUNTIME_DIR=/tmp/run-user
|
podman build "$REGISTRY/$IMAGE_NAME:$TAG" .
|
||||||
export HOME=/tmp/home
|
|
||||||
mkdir -p $XDG_RUNTIME_DIR $HOME
|
|
||||||
# Ensure Podman is installed
|
|
||||||
if ! command -v podman &> /dev/null; then
|
|
||||||
echo "Podman not found, installing..."
|
|
||||||
sudo apt-get update && sudo apt-get install -y podman
|
|
||||||
fi
|
|
||||||
podman info || true # info will fail if storage driver is overlay, ignore
|
|
||||||
|
|
||||||
|
|
||||||
- name: Log in to Docker registry
|
- name: Log in to Docker registry
|
||||||
run: |
|
|
||||||
echo "${REGISTRY_PASSWORD}" | podman login ${GITEA_REGISTRY} \
|
|
||||||
--username ${REGISTRY_USERNAME} --password-stdin
|
|
||||||
env:
|
env:
|
||||||
|
REGISTRY: https://gitea.papryk.com
|
||||||
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
echo "$REGISTRY_PASSWORD" | podman login "$REGISTRY" -u "$REGISTRY_USERNAME" --password-stdin
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
run: |
|
|
||||||
IMAGE_TAG="Papryk/dj-spangebob:${{ gitea.ref_name }}"
|
|
||||||
echo "Building image $IMAGE_TAG"
|
|
||||||
podman build -t "$IMAGE_TAG" .
|
|
||||||
echo "Pushing image $IMAGE_TAG"
|
|
||||||
podman push "$IMAGE_TAG"
|
|
||||||
env:
|
env:
|
||||||
|
REGISTRY: https://gitea.papryk.com
|
||||||
|
IMAGE_NAME: Papryk/dj-spangebob
|
||||||
TAG: ${{ gitea.ref_name }}
|
TAG: ${{ gitea.ref_name }}
|
||||||
|
run: |
|
||||||
|
podman push "$REGISTRY/$IMAGE_NAME:$TAG"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user