Skip to content

Commit

Permalink
Attempt to fix build image workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
KINGTUT10101 committed Nov 27, 2023
1 parent 08cc107 commit 7363a6a
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/buildImage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
branches:
- main

env:
REGISTRY: docker.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -14,6 +18,12 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Build image
run: docker-compose build --no-cache --force-rm

- name: Test image
run: docker-compose up -d

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -24,10 +34,16 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v2
with:
context: .
file: ./docker-compose.yml
context: "{{defaultContext}}"
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/contentsharingplatform:latest
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 7363a6a

Please sign in to comment.