Skip to content

Commit

Permalink
Build tna-python-root image
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Jan 8, 2025
1 parent ee6beb1 commit 97c101d
Showing 1 changed file with 59 additions and 61 deletions.
120 changes: 59 additions & 61 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,69 +88,69 @@ jobs:
# image-id: ${{ steps.build.outputs.image-id }}
# image-tag: ${{ steps.build.outputs.tag }}

# python-root:
# name: Python (root)
# runs-on: ubuntu-latest
# timeout-minutes: 15
# env:
# IMAGE_NAME: tna-python-root
# DOCKERFILE_LOCATION: docker/tna-python
# BASE_IMAGE: ghcr.io/nationalarchives/tna-python
# USER_IMAGE: root
# steps:
# - name: Checkout
# uses: actions/checkout@v4
python-root:
name: Python (root)
runs-on: ubuntu-latest
timeout-minutes: 15
env:
IMAGE_NAME: tna-python-root
DOCKERFILE_LOCATION: docker/tna-python
BASE_IMAGE: ghcr.io/nationalarchives/tna-python
USER_IMAGE: root
steps:
- name: Checkout
uses: actions/checkout@v4

# - name: Lint Dockerfile
# uses: ./.github/actions/lint
# with:
# dockerfile-location: ${{ env.DOCKERFILE_LOCATION }}
# ignore-linting-rules: DL3002
- name: Lint Dockerfile
uses: ./.github/actions/lint
with:
dockerfile-location: ${{ env.DOCKERFILE_LOCATION }}
ignore-linting-rules: DL3002

# - name: Test Docker image build
# id: build
# uses: ./.github/actions/test-build
# with:
# image-name: ${{ env.IMAGE_NAME }}
# base-image: ${{ env.BASE_IMAGE }}
# dockerfile-location: ${{ env.DOCKERFILE_LOCATION }}
# user-image: ${{ env.USER_IMAGE }}
- name: Test Docker image build
id: build
uses: ./.github/actions/test-build
with:
image-name: ${{ env.IMAGE_NAME }}
base-image: ${{ env.BASE_IMAGE }}
dockerfile-location: ${{ env.DOCKERFILE_LOCATION }}
user-image: ${{ env.USER_IMAGE }}

# - name: Test Flask
# uses: ./.github/actions/test-container
# with:
# application-repository: nationalarchives/flask-application-template
# service: app
# image: ${{ env.IMAGE_NAME }}
# image-tag: ${{ steps.build.outputs.tag }}
# expected-user: root
- name: Test Flask
uses: ./.github/actions/test-container
with:
application-repository: nationalarchives/flask-application-template
service: app
image: ${{ env.IMAGE_NAME }}
image-tag: ${{ steps.build.outputs.tag }}
expected-user: root

# - name: Test FastAPI
# uses: ./.github/actions/test-container
# with:
# application-repository: nationalarchives/fastapi-application-template
# service: app
# image: ${{ env.IMAGE_NAME }}
# image-tag: ${{ steps.build.outputs.tag }}
# expected-user: root
- name: Test FastAPI
uses: ./.github/actions/test-container
with:
application-repository: nationalarchives/fastapi-application-template
service: app
image: ${{ env.IMAGE_NAME }}
image-tag: ${{ steps.build.outputs.tag }}
expected-user: root

# - name: Build and push Docker images
# uses: ./.github/actions/push
# with:
# image-id: ${{ steps.build.outputs.image-id }}
# image-tag: ${{ steps.build.outputs.tag }}
# major-version: ${{ steps.build.outputs.major-version }}
# minor-version: ${{ steps.build.outputs.minor-version }}
# base-image: ${{ env.BASE_IMAGE }}
# dockerfile-location: ${{ env.DOCKERFILE_LOCATION }}
# user-image: ${{ env.USER_IMAGE }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
uses: ./.github/actions/push
with:
image-id: ${{ steps.build.outputs.image-id }}
image-tag: ${{ steps.build.outputs.tag }}
major-version: ${{ steps.build.outputs.major-version }}
minor-version: ${{ steps.build.outputs.minor-version }}
base-image: ${{ env.BASE_IMAGE }}
dockerfile-location: ${{ env.DOCKERFILE_LOCATION }}
user-image: ${{ env.USER_IMAGE }}
github-token: ${{ secrets.GITHUB_TOKEN }}

# - name: Scan Docker image
# uses: ./.github/actions/scan
# with:
# image-id: ${{ steps.build.outputs.image-id }}
# image-tag: ${{ steps.build.outputs.tag }}
- name: Scan Docker image
uses: ./.github/actions/scan
with:
image-id: ${{ steps.build.outputs.image-id }}
image-tag: ${{ steps.build.outputs.tag }}

# python-django:
# name: Python Django
Expand Down Expand Up @@ -265,7 +265,7 @@ jobs:

python-dev:
name: Python Dev
# needs: python-root
needs: python-root
runs-on: ubuntu-latest
timeout-minutes: 5
env:
Expand Down Expand Up @@ -314,9 +314,7 @@ jobs:
echo "print( 'test' ) " >> tests/test.py
# Run the dev container
docker run -v ./tests:/app/tests --name test_container -d ghcr.io/${{ github.repository_owner }}/${{ steps.build.outputs.image-id }}:preview
# TODO: Enable once not using preview
# docker run -v ./tests:/app/tests --name test_container -d ghcr.io/${{ github.repository_owner }}/${{ steps.build.outputs.image-id }}:${{ steps.build.outputs.tag }}
docker run -v ./tests:/app/tests --name test_container -d ghcr.io/${{ github.repository_owner }}/${{ steps.build.outputs.image-id }}:${{ steps.build.outputs.tag }}
# Copy configuration files from container
docker cp test_container:/home/app/.eslintrc.js .eslintrc.js
Expand Down

0 comments on commit 97c101d

Please # to comment.