Update docker-publish.yml

This commit is contained in:
Gabor FELEGYHAZI
2022-06-29 13:54:13 +02:00
committed by GitHub
parent 439718de1e
commit 278d120310

View File

@@ -15,9 +15,6 @@ on:
branches: [ "main" ]
env:
PACK_VERSION: "0.27.0"
YQ_VERSION: "4.25.3"
JQ_VERSION: "1.6"
COMPOSER_AUTH: "{\"github-oauth\":{\"github.com\":\"${{ secrets.HVG_DEV_GH_TOKEN }}\"}}"
jobs:
@@ -27,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- uses: andrioid/setup-pack@v1.0.1
- uses: buildpacks/github-actions/setup-pack@v4.8.0
- name: Docker registry login
uses: docker/login-action@v1
with:
@@ -43,53 +40,11 @@ jobs:
tag="${GITHUB_REF#tags/*/}";
[[ $tag == '' ]] || tag="${year}.${day}.${{ github.run_number }}";
echo "TAG=$tag" >> $GITHUB_ENV;
- name: Setup Pack
run: |
echo "Installing pack ${PACK_VERSION}"
mkdir -p "${PWD}/bin"
curl \
--show-error \
--silent \
--location \
--fail \
--retry 3 \
--connect-timeout 5 \
--max-time 60 \
"https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux.tgz" \
| tar -C "${PWD}/bin" -xz pack
- name: Setup YQ
run: |
echo "Installing yq ${YQ_VERSION}"
curl \
--show-error \
--silent \
--location \
--fail \
--retry 3 \
--connect-timeout 5 \
--max-time 60 \
"https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64.tar.gz" \
| tar -C "${PWD}/bin" --transform='flags=r;s|yq_linux_amd64|yq|' -xz --wildcards 'yq'
- name: Setup JQ
run: |
echo "Installing jq ${JQ_VERSION}"
mkdir -p "${PWD}/bin"
curl \
--show-error \
--silent \
--location \
--fail \
--retry 3 \
--connect-timeout 5 \
--max-time 60 \
-o "${PWD}/bin/jq"
"https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-${JQ_VERSION}.tar.gz"
chmod +x "${PWD}/bin/jq"
- name: Build Image with pack
run: |
[[ ! -z $(bin/yq e '. | keys' Procfile | cut -c 3- | grep bash) ]] \
[[ ! -z $(yq e '. | keys' Procfile | cut -c 3- | grep bash) ]] \
|| echo 'bash: bash -l' >> Procfile
bin/pack build "ghcr.io/hvg/blog:$TAG" \
pack build "ghcr.io/hvg/blog:$TAG" \
--builder heroku/buildpacks:20 \
--descriptor project.toml \
--workspace /app \