Skip to content

chore: trye

chore: trye #18

Workflow file for this run

name: Create and Publish a Docker Image
on:
push:
branches:
- main
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set IMAGE_NAME
run: echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Login to the Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
run: |
IMAGE_TAG=latest
IMG_NAME=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
echo "Building and pushing $IMG_NAME:$IMAGE_TAG"
docker build --build-arg "LITCRYPT_ENCRYPT_KEY=${{ secrets.LITCRYPT_ENCRYPT_KEY }}" \
--build-arg "STRIPE_SECRET=${{ secrets.STRIPE_SECRET }}" \
-t $IMG_NAME:$IMAGE_TAG .
docker push $IMG_NAME:$IMAGE_TAG