Skip to content

added script for start #18

added script for start

added script for start #18

name: Build Production Image
on:
push:
branches:
- docker
env:
REGISTRY: ghcr.io
SERVER_IMAGE_NAME: spreehood/spree-backend
jobs:
build_and_deploy:
runs-on: ubuntu-latest
environment: production
env:
APP_NAME: spree-backend
BASE_DOCKER_IMAGE: ruby:3.2.0
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.SERVER_IMAGE_NAME }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
id: build
with:
context: .
file: ./Dockerfile.production
platforms: linux/amd64
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/spreehood/spree-backend:latest, ghcr.io/spreehood/spree-backend:${{github.ref_name}}
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-webapp
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1