diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml index e8187d5c..33a1601d 100644 --- a/.github/workflows/build-test-deploy.yml +++ b/.github/workflows/build-test-deploy.yml @@ -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/pack-action@v2.1.1 - 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/setup-pack@v5.4.0 + - 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 < 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 <