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

restore expressions #47

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
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
23 changes: 9 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ permissions:
packages: write
pull-requests: write

env:
IS_NOT_ACT: ${{ github.actor != 'nektos/act' }}
IS_PULL_REQUEST: ${{ github.event_name == 'pull_request' }}

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -122,7 +118,7 @@ jobs:
# platforms: ${{ matrix.platforms }}
# labels: ${{ steps.meta.outputs.labels }}
# tags: ${{ steps.meta.outputs.tags }}
# # tags: ${{ format('{0}:{1}-{2}', env.IS_NOT_ACT && env.REGISTRY_IMAGE || env.IMAGE_REPOSITORY, matrix.from-version, github.head_ref || github.ref_name) }}
# # tags: ${{ format('{0}:{1}-{2}', github.actor != 'nektos/act' && env.REGISTRY_IMAGE || env.IMAGE_REPOSITORY, matrix.from-version, github.head_ref || github.ref_name) }}
# build-args: |
# FROM_IMAGE=buildpack-deps
# FROM_VERSION_MAJOR=${{ matrix.from-version-major }}
Expand All @@ -147,7 +143,7 @@ jobs:
# Get the architecture to use for the cache tag
- name: get arch
id: cache-arch
if: env.IS_PULL_REQUEST
if: github.event_name == 'pull_request'
run: >-
printf "CACHE_ARCH=%s\n" "$(
docker run
Expand All @@ -158,7 +154,7 @@ jobs:
/bin/bash -c "dpkg --print-architecture"
)" >> "$GITHUB_OUTPUT"
env:
PULL_IMAGE: ubuntu:22.04
PULL_IMAGE: ${{ format('{0}:{1}', matrix.distro, matrix.codename) }}

# Build and push Docker images
- name: build image
Expand All @@ -171,7 +167,7 @@ jobs:
--cache-from ${{ format('type=registry,ref={0}:cache-{1}-{2}', env.REGISTRY_IMAGE, matrix.codename, 'amd64') }}
--cache-from ${{ format('type=registry,ref={0}:cache-{1}-{2}', env.REGISTRY_IMAGE, matrix.codename, 'arm64') }}
--ulimit=nofile=4096:4096
${{ (env.IS_PULL_REQUEST && env.IS_NOT_ACT) && format('--cache-to type=registry,ref={0}:cache-{1}-{2},mode=max', env.REGISTRY_IMAGE, matrix.codename, steps.cache-arch.outputs.CACHE_ARCH) || '' }}
${{ github.event_name == 'pull_request' && github.actor != 'nektos/act' && format('--cache-to type=registry,ref={0}:cache-{1}-{2},mode=max', env.REGISTRY_IMAGE, matrix.codename, steps.cache-arch.outputs.CACHE_ARCH) || '' }}
--build-arg FROM_IMAGE='buildpack-deps'
--build-arg FROM_VERSION_MAJOR='${{ matrix.from-version-major }}'
--build-arg FROM_VERSION_MINOR='${{ matrix.from-version-minor }}'
Expand All @@ -189,9 +185,8 @@ jobs:
--label org.opencontainers.image.vendor='${{ github.repository_owner }}'
.
env:
IS_MAIN: ${{ github.ref == 'refs/heads/main' }}
OUTPUT_KIND: ${{ env.IS_MAIN && 'push=true' || format('dest={0}', env.FROM_IMAGE_PATH) }}
OUTPUT_TYPE: ${{ env.IS_MAIN && 'registry' || 'docker' }}
OUTPUT_KIND: ${{ github.ref == 'refs/heads/main' && 'push=true' || format('dest={0}', env.FROM_IMAGE_PATH) }}
OUTPUT_TYPE: ${{ github.ref == 'refs/heads/main' && 'registry' || 'docker' }}
REGISTRY_IMAGE: ${{ format('{0}/{1}', env.REGISTRY, env.IMAGE_REPOSITORY) }}
REPOSITORY_LINK: https://github.com/${{ github.repository }}
TAG_AUTHORS: ${{ format('{0},{1}', env.REPOSITORY_LINK, github.triggering_actor) }}
Expand All @@ -201,7 +196,7 @@ jobs:
- name: Docker Scout
id: docker-scout
uses: docker/[email protected]
if: env.IS_PULL_REQUEST
if: github.event_name == 'pull_request'
with:
platform: ${{ matrix.platforms }}
command: quickview
Expand All @@ -210,8 +205,8 @@ jobs:
to: ${{ env.TO_TAG }}
ignore-unchanged: true
only-severities: critical
write-comment: ${{ env.IS_NOT_ACT }}
summary: ${{ env.IS_NOT_ACT }}
write-comment: ${{ github.actor != 'nektos/act' }}
summary: ${{ github.actor != 'nektos/act' }}
github-token: ${{ secrets.GITHUB_TOKEN }}
organization: ${{ vars.DOCKERHUB_USER || github.repository_owner }}

Expand Down
11 changes: 8 additions & 3 deletions linux/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ RUN apt-get update \
locales \
&& rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8
LC_ALL=en_US.UTF-8 \
RUNNER_MANUALLY_TRAP_SIG=1 \
ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=1

# enable pipefail and set workdir
SHELL [ "/bin/bash", "--login", "-e", "-o", "pipefail", "-c" ]
Expand All @@ -59,7 +62,9 @@ RUN locale | tee -a /etc/environment \
&& echo "DEPLOYMENT_BASEPATH=/opt/runner" | tee -a /etc/environment \
&& echo "LSB_OS_VERSION=${FROM_VERSION_MAJOR}${FROM_VERSION_MINOR}" | tee -a /etc/environment \
&& echo "USER=$(whoami)" | tee -a /etc/environment \
&& echo "RUNNER_USER=$(whoami)" | tee -a /etc/environment
&& echo "RUNNER_USER=$(whoami)" | tee -a /etc/environment \
&& echo "RUNNER_MANUALLY_TRAP_SIG=${RUNNER_MANUALLY_TRAP_SIG}" | tee -a /etc/environment \
&& echo "ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=${ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT}" | tee -a /etc/environment

# add ssh keys of github and azure devops
# hadolint ignore=SC2174
Expand Down Expand Up @@ -267,10 +272,10 @@ ENV PATH=${PIPX_BIN_DIR}:${PATH}

# Install Go
ENV PATH=/usr/local/go/bin:${PATH}
ENV GOLANG_VERSION=1.20.8
# hadolint ignore=SC2086
RUN export GOLANG_SHA256_amd64=cc97c28d9c252fbf28f91950d830201aa403836cbed702a05932e63f7f0c7bc4 \
GOLANG_SHA256_arm64=15ab379c6a2b0d086fe3e74be4599420e66549edf7426a300ee0f3809500f89e \
GOLANG_VERSION=1.20.8 \
&& curl -fsSL https://golang.org/dl/go"${GOLANG_VERSION}".linux-"${TARGETARCH}".tar.gz -o /tmp/go.tgz \
&& go_sha="${go_sha=GOLANG_SHA256_${TARGETARCH}}" \
&& echo "${!go_sha} /tmp/go.tgz" | sha256sum -c - \
Expand Down