46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
RAILS_ENV: production
|
|
CONTAINER_IMAGE: ${{ secrets.REGISTRY_IMAGE }}:${{ github.ref_name }}-${{ github.sha }}
|
|
DOCKER_HOST: tcp://localhost:2375
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
container:
|
|
image: node:22 # Optionally install Docker CLI in a step
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Podman
|
|
run: |
|
|
apt-get update && apt-get install -y podman
|
|
|
|
- name: Podman info
|
|
run: podman info
|
|
|
|
# - name: Log in to registry
|
|
# run: |
|
|
# echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login \
|
|
# -u "${{ secrets.REGISTRY_USER }}" \
|
|
# --password-stdin \
|
|
# ${{ secrets.REGISTRY_URL }}
|
|
#
|
|
# - name: Build Docker image
|
|
# run: |
|
|
# docker build -t "$CONTAINER_IMAGE" .
|
|
# docker tag "$CONTAINER_IMAGE" "${{ secrets.REGISTRY_IMAGE }}:latest"
|
|
#
|
|
# - name: Push Docker image
|
|
# run: |
|
|
# docker push "$CONTAINER_IMAGE"
|
|
# docker push "${{ secrets.REGISTRY_IMAGE }}:latest"
|