Skip to content

Commit 5896f34

Browse files
committed
chore: trye
1 parent ce3a29d commit 5896f34

File tree

1 file changed

+16
-25
lines changed

1 file changed

+16
-25
lines changed

.github/workflows/docker.yml

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
name: Create and publish a Docker image
1+
2+
name: Create and Publish a Docker Image
23

34
on:
45
push:
5-
tags:
6-
- "**"
76
branches:
87
- main
98
workflow_dispatch:
10-
inputs:
11-
tag:
12-
description: ""
13-
required: true
14-
type: string
159

1610
env:
1711
REGISTRY: ghcr.io
@@ -24,33 +18,30 @@ jobs:
2418
packages: write
2519
attestations: write
2620
id-token: write
21+
2722
steps:
2823
- name: Checkout repository
2924
uses: actions/checkout@v4
30-
- name: downcase REPO
31-
run: |
32-
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
33-
- name: Login to the Container registry
34-
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
25+
26+
- name: Set IMAGE_NAME
27+
run: echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
28+
29+
- name: Login to the Container Registry
30+
uses: docker/login-action@v2
3531
with:
3632
registry: ${{ env.REGISTRY }}
3733
username: ${{ github.actor }}
3834
password: ${{ secrets.GITHUB_TOKEN }}
39-
- name: Extract metadata (tags, labels) for Docker
40-
id: meta
41-
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
42-
with:
43-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4435

45-
- name: Push image to DO Container Registry
36+
- name: Build and Push Docker Image
4637
env:
4738
LITCRYPT_ENCRYPT_KEY: ${{ secrets.LITCRYPT_ENCRYPT_KEY }}
4839
STRIPE_SECRET: ${{ secrets.STRIPE_SECRET }}
49-
run: docker compose build --push
50-
51-
- name: Push Docker image
5240
run: |
53-
IMG_NAME=${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
54-
IMAGE_TAG=${{ inputs.tag || steps.meta.outputs.labels.org.opencontainers.image.version || 'latest' }}
55-
docker tag ${{ env.IMAGE_NAME }}:$IMAGE_TAG $IMG_NAME:$IMAGE_TAG
41+
IMAGE_TAG=latest
42+
IMG_NAME=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
43+
echo "Building and pushing $IMG_NAME:$IMAGE_TAG"
44+
docker build --build-arg LITCRYPT_ENCRYPT_KEY=${{ secrets.LITCRYPT_ENCRYPT_KEY }} \
45+
--build-arg STRIPE_SECRET=${{ secrets.STRIPE_SECRET }} \
46+
-t $IMG_NAME:$IMAGE_TAG .
5647
docker push $IMG_NAME:$IMAGE_TAG

0 commit comments

Comments
 (0)