Skip to content

Commit

Permalink
Merge pull request #33 from aodn/update_test
Browse files Browse the repository at this point in the history
test.yml: make docker build steps more generic
  • Loading branch information
digorgonzola authored Jan 24, 2024
2 parents 9e081bf + 294763c commit 2f0e742
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:
contents: read

jobs:
build_test_push:
build_test:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -34,23 +34,13 @@ jobs:
&& chmod +x container-structure-test-linux-amd64 && sudo mv container-structure-test-linux-amd64
/usr/local/bin/container-structure-test
- name: Set Image Tag
id: set_image_tag
run: |
branch_name=${{ github.head_ref || github.ref_name }}
tag=${{ env.TAG_PREFIX}}-${branch_name//\//-}
echo "$tag"
echo "image_tag=$tag" >> $GITHUB_OUTPUT
env:
TAG_PREFIX: test

- name: Build Docker Image
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ vars.ECR_REPOSITORY }}:${{ steps.set_image_tag.outputs.image_tag }}
tags: image:${{ github.sha }}

- name: Test Docker Image
run: |
container-structure-test test --image ${{ vars.ECR_REPOSITORY }}:${{ steps.set_image_tag.outputs.image_tag }} --config tests/config.yaml
container-structure-test test --image image:${{ github.sha }} --config tests/config.yaml

0 comments on commit 2f0e742

Please sign in to comment.