Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
re-enable conditional build
Browse files Browse the repository at this point in the history
  • Loading branch information
usrbinkat authored Jan 22, 2024
1 parent eb6a040 commit 843c42d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 83 deletions.
63 changes: 31 additions & 32 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,44 +76,43 @@ jobs:
uses: Entepotenz/change-string-case-action-min-dependencies@v1
with:
string: ${{ github.repository }}
# -
# name: Build Container Image
# id: docker_build
# uses: docker/build-push-action@v5
# with:
# push: false
# load: true
# cache-to: type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}
# cache-from: type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}
# context: docker
# file: docker/Dockerfile
# platforms: linux/amd64,linux/arm64
# tags: "ghcr.io/${{ steps.repository.outputs.lowercase }}:latest,ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}"
# -
# name: Push Container Image
# id: docker_build_push
# #if: ${{ github.event_name == 'push' }} && ${{ github.ref == 'refs/heads/main' }}
# uses: docker/build-push-action@v5
# with:
# push: true
# #oad: false
# #ache-to: type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}
# #ache-from: type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}
# context: docker
# file: docker/Dockerfile
# platforms: linux/amd64,linux/arm64
# tags: "ghcr.io/${{ steps.repository.outputs.lowercase }}:latest,ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}"

-
if: ${{ github.event_name == 'push' }} && ${{ github.ref == 'refs/heads/main' }}
name: Container Build & Push
name: Build Container Image
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
uses: docker/build-push-action@v5
with:
push: false
cache-from: type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:latest
cache-to: type=inline
context: ./docker
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
tags: "ghcr.io/${{ steps.repository.outputs.lowercase }}:latest,ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}"

-
name: Push Container Image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
id: container-push
with:
push: true
cache-from: type=inline
cache-from: type=registry,ref=ghcr.io/${{ steps.repository.outputs.lowercase }}:latest
cache-to: type=inline
context: ./docker
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
annotations: '"annotations": { "org.opencontainers.image.description": "Pulumi Devcontainer" }'
tags: "ghcr.io/${{ steps.repository.outputs.lowercase }}:latest,ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}"

# -
# if: ${{ github.event_name == 'push' }} && ${{ github.ref == 'refs/heads/main' }}
# name: Container Build & Push
# uses: docker/build-push-action@v5
# id: container-push
# with:
# push: true
# cache-from: type=inline
# context: ./docker
# file: ./docker/Dockerfile
# platforms: linux/amd64,linux/arm64
# annotations: '"annotations": { "org.opencontainers.image.description": "Pulumi Devcontainer" }'
# tags: "ghcr.io/${{ steps.repository.outputs.lowercase }}:latest,ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ github.sha }}"
41 changes: 0 additions & 41 deletions docker/.dockerignore

This file was deleted.

20 changes: 10 additions & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -688,13 +688,13 @@ RUN set -ex \
&& rm -rf /tmp/* \
&& true

##################################################################################
## Load startup artifacts
#COPY ./docker/bin/connect /bin/
#COPY ./docker/bin/entrypoint /bin/
#
##################################################################################
## Entrypoint & default command
#WORKDIR /workspaces
#ENTRYPOINT /bin/entrypoint
#CMD ["/usr/bin/env", "connect"]
#################################################################################
# Load startup artifacts
COPY ./docker/bin/connect /bin/
COPY ./docker/bin/entrypoint /bin/

#################################################################################
# Entrypoint & default command
WORKDIR /workspaces
ENTRYPOINT /bin/entrypoint
CMD ["/usr/bin/env", "connect"]

0 comments on commit 843c42d

Please sign in to comment.