forked from sjoshi10/docker-ansible-core
-
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.
sc-89752 add the docker spec for build_push_python38_and_later
- Loading branch information
1 parent
b0da6bd
commit 8e65fa3
Showing
1 changed file
with
47 additions
and
51 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 |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
build_push_before_python38: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
contents: write | ||
packages: write | ||
strategy: | ||
matrix: | ||
|
@@ -34,11 +34,7 @@ jobs: | |
run: | | ||
cp requirements/${MATRIX_VERSION}/requirements.txt requirements/requirements.txt | ||
TAGS="${IMAGE_NAME}:${MATRIX_VERSION}-${MATRIX_OS}" | ||
# if [[ "$MATRIX_OS" == "$LATEST_OS" ]]; then | ||
# TAGS="${TAGS},${IMAGE_NAME}:$MATRIX_VERSION" | ||
# elif [[ "$MATRIX_OS" == "almalinux8" && "$MATRIX_VERSION" == "v2.11" ]]; then | ||
# TAGS="${TAGS},${IMAGE_NAME}:latest-${MATRIX_OS}" | ||
# fi | ||
echo "::set-output name=tags::${TAGS}" | ||
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
env: | ||
|
@@ -66,55 +62,55 @@ jobs: | |
context: . | ||
file: ./Dockerfile.${{ matrix.os }} | ||
tags: | | ||
ghcr.io/quicknode-labs/docker-ansible-core:${{ matrix.os }}-${{ matrix.version }} | ||
ghcr.io/quiknode-labs/docker-ansible-core:${{ matrix.os }}-${{ matrix.version }} | ||
push: true | ||
|
||
build_push_python38_and_later: | ||
needs: build_push_before_python38 | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
strategy: | ||
matrix: | ||
os: [alpine, ubuntu] | ||
version: [v2.12, v2.13,v2.15] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# - name: Push image | ||
# run: | | ||
# IMAGE_ID=ghcr.io/quicknode-labs/docker-ansible-core | ||
# # Change all uppercase to lowercase | ||
# IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
|
||
# VERSION=latest | ||
# if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
# VERSION=${GITHUB_REF#refs/tags/} | ||
# fi | ||
|
||
# docker tag ${{ steps.prep.outputs.tags }} $IMAGE_ID:$VERSION | ||
# docker push $IMAGE_ID:$VERSION | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
# build: | ||
|
||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - uses: actions/checkout@v2 | ||
|
||
# - name: Build image | ||
# run: docker build --platform linux/amd64 -t myimage . | ||
|
||
# - name: Log into registry | ||
# run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
- name: Prepare | ||
id: prep | ||
run: | | ||
cp requirements/${MATRIX_VERSION}/requirements.txt requirements/requirements.txt | ||
TAGS="${IMAGE_NAME}:${MATRIX_VERSION}-${MATRIX_OS}" | ||
# - name: Push image | ||
# run: | | ||
# IMAGE_ID=ghcr.io/${{ github.repository }} | ||
echo "::set-output name=tags::${TAGS}" | ||
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
env: | ||
MATRIX_OS: ${{ matrix.os }} | ||
MATRIX_VERSION: ${{ matrix.version }} | ||
|
||
# # Change all uppercase to lowercase | ||
# IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
|
||
# VERSION=latest | ||
# if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
# VERSION=${GITHUB_REF#refs/tags/} | ||
# fi | ||
- name: Log into registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
||
# docker tag myimage $IMAGE_ID:$VERSION | ||
# docker push $IMAGE_ID:$VERSION | ||
- name: Build and Push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
labels: | | ||
org.opencontainers.image.created=${{ steps.prep.outputs.created }} | ||
org.opencontainers.image.source=${{ github.repositoryUrl }} | ||
org.opencontainers.image.version=${{ matrix.version }} | ||
org.opencontainers.image.revision=${{ github.sha }} | ||
org.opencontainers.image.licenses=${{ github.event.repository.license.name }} | ||
build-args: | | ||
docker_version=${{ env.DOCKER_CLI_VERSION }} | ||
gosu_version=${{ env.GOSU_VERSION }} | ||
context: . | ||
file: ./Dockerfile.${{ matrix.os }} | ||
tags: | | ||
ghcr.io/quiknode-labs/docker-ansible-core:${{ matrix.os }}-${{ matrix.version }} | ||
push: true |