-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
22 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,22 +8,34 @@ on: | |
jobs: | ||
build: | ||
name: Build Docker image from the branch ${{ github.ref_name }} | ||
runs-on: ubuntu-24.04 | ||
runs-on: ubuntu-22.04 | ||
environment: ${{ github.ref_name }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: Pack Build | ||
uses: dfreilich/[email protected] | ||
with: | ||
args: 'build tmp-cnb-image --builder heroku/builder:24_linux-amd64' | ||
- name: Suggest default port 5000 within image | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Set up pack | ||
uses: buildpacks/github-actions/[email protected] | ||
- name: Build using heroku/buildpacks:22 CNB | ||
env: | ||
SECRETS_CONTEXT: ${{ toJson(secrets) }} | ||
VARS_CONTEXT: ${{ toJson(vars) }} | ||
PUBLIC_URL: ${{ inputs.PUBLIC_URL }} | ||
run: | | ||
echo -n "$SECRETS_CONTEXT" | jq -r '[to_entries[]|select(.key|startswith("K8S_SECRET_"))]|map("\(.key|sub("K8S_SECRET_"; ""))=\(.value|tostring|@sh)")|.[]' > secrets.env | ||
cat >> Dockerfile <<EOF | ||
echo -n "$SECRETS_CONTEXT" | jq -r '[to_entries[]|select(.key|startswith("K8S_SECRET_"))]|map("\(.key|sub("K8S_SECRET_"; ""))=\(.value|tostring)")|.[]' > secrets.env | ||
echo -n "$VARS_CONTEXT" | jq -r '[to_entries[]|select(.key|startswith("K8S_SECRET_"))]|map("\(.key|sub("K8S_SECRET_"; ""))=\(.value|tostring)")|.[]' >> secrets.env | ||
echo -n "$SECRETS_CONTEXT" | jq -r '[to_entries[]|select(.key|startswith("LC_K8S_SECRET_"))]|map("\(.key|sub("LC_K8S_SECRET_"; "")|ascii_downcase)=\(.value|tostring)")|.[]' >> secrets.env | ||
echo -n "$VARS_CONTEXT" | jq -r '[to_entries[]|select(.key|startswith("LC_K8S_SECRET_"))]|map("\(.key|sub("LC_K8S_SECRET_"; "")|ascii_downcase)=\(.value|tostring)")|.[]' >> secrets.env | ||
pack build tmp-cnb-image --env-file secrets.env --builder heroku/builder:22 \ | ||
--cache-image tmp-cnb-image:cache --publish | ||
rm secrets.env | ||
cat > Dockerfile <<EOF | ||
ARG source_image | ||
FROM tmp-cnb-image | ||
ARG default_port | ||
ENV PORT=5000 | ||
EXPOSE 5000 | ||
EXPOSE 5000 | ||
EOF | ||
- name: login to github container registry | ||
uses: docker/login-action@v3 | ||
|
@@ -56,7 +68,7 @@ jobs: | |
labels: ${{ steps.meta.outputs.labels }} | ||
test: | ||
name: Test code from the branch ${{ github.ref_name }} | ||
runs-on: ubuntu-24.04 | ||
runs-on: ubuntu-22.04 | ||
environment: ${{ github.ref_name }} | ||
steps: | ||
- name: checkout | ||
|