Skip to content

Commit

Permalink
Merge pull request #101 from epics-containers/dev
Browse files Browse the repository at this point in the history
remove container build from CI
  • Loading branch information
gilesknap authored Sep 14, 2023
2 parents 4b7189c + 206b74a commit 1a98239
Showing 1 changed file with 0 additions and 83 deletions.
83 changes: 0 additions & 83 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,89 +110,6 @@ jobs:
# If more than one module in src/ replace with module name to test
run: python -m $(ls src | head -1) --version

container:
needs: [lint, dist, test]
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

env:
TEST_TAG: "testing"

steps:
- name: Checkout
uses: actions/checkout@v4

# image names must be all lower case
- name: Generate image repo name
run: echo IMAGE_REPOSITORY=ghcr.io/$(tr '[:upper:]' '[:lower:]' <<< "${{ github.repository }}") >> $GITHUB_ENV

- name: Download wheel and lockfiles
uses: actions/download-artifact@v3
with:
path: artifacts/

- name: Log in to GitHub Docker Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Build and export to Docker local cache
uses: docker/build-push-action@v4
with:
# Note build-args, context, file, and target must all match between this
# step and the later build-push-action, otherwise the second build-push-action
# will attempt to build the image again
build-args: |
PIP_OPTIONS=-r lockfiles/requirements.txt dist/*.whl
context: artifacts/
file: ./Dockerfile
target: runtime
load: true
tags: ${{ env.TEST_TAG }}
# If you have a long docker build (2+ minutes), uncomment the
# following to turn on caching. For short build times this
# makes it a little slower
#cache-from: type=gha
#cache-to: type=gha,mode=max

- name: Test cli works in cached runtime image
run: docker run docker.io/library/${{ env.TEST_TAG }} --version

- name: Create tags for publishing image
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.IMAGE_REPOSITORY }}
tags: |
type=ref,event=tag
type=raw,value=latest, enable=${{ github.ref_type == 'tag' }}
# type=edge,branch=main
# Add line above to generate image for every commit to given branch,
# and uncomment the end of if clause in next step

- name: Push cached image to container registry
if: github.ref_type == 'tag' # || github.ref_name == 'main'
uses: docker/build-push-action@v3
with:
build-args: |
PIP_OPTIONS=-r lockfiles/requirements.txt dist/*.whl
context: artifacts/
file: ./Dockerfile
target: runtime
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

release:
# upload to PyPI and make a release on every tag
needs: [lint, dist, test]
Expand Down

0 comments on commit 1a98239

Please sign in to comment.