Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add build envars to Dockerfiles and images #59

Merged
merged 5 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ runs:
with:
repository: ${{ inputs.repository }}

- name: Add build envars to Dockerfile
if: steps.build.outputs.triggered == 'true'
env:
dockerfile: ${{ steps.vars.outputs.build_file }}
shell: bash
run: |
# Add build envars to Dockerfile
echo "ENV BUILDER_IMAGE=ghcr.io/${{ github.repository }}/${{ inputs.package }}:${{ inputs.tag }}" >> ${{ env.dockerfile }}
echo "ENV BUILDER_PACKAGE=${{ inputs.package }}" >> ${{ env.dockerfile }}
echo "ENV BUILDER_REPO=${{ github.repository }}" >> ${{ env.dockerfile }}
echo "ENV BUILDER_TAG=${{ inputs.tag }}" >> ${{ env.dockerfile }}

- name: Set up Docker Buildx
if: steps.build.outputs.triggered == 'true'
uses: docker/setup-buildx-action@v3
Expand All @@ -156,7 +168,7 @@ runs:
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.token }}
password: ${{ inputs.token }}

- name: Build and push ${{ inputs.package }} Docker image
if: steps.build.outputs.triggered == 'true'
Expand Down