-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (39 loc) · 1.41 KB
/
test-action-on-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Test on PR github-actions-build-push-containers
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
test_action:
runs-on: ubuntu-latest
steps:
- name: set variables
run: |
echo "TEST_IMAGE_NAME=glueops/github-actions-build-push-containers/test-github-actions-build-push-containers" >> $GITHUB_ENV
echo "ECR_REGISTRY=616531474007.dkr.ecr.us-west-2.amazonaws.com" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v3
- name: test ghcr.io
uses: ./
with:
image_name: ${{ env.TEST_IMAGE_NAME }}
registry: "ghcr.io"
context: "./test-directory/tests/"
target_directory: test-directory
- name: verify ghcr.io
run: |
docker pull ghcr.io/$TEST_IMAGE_NAME:${{ github.sha }}
docker run ghcr.io/$TEST_IMAGE_NAME:${{ github.sha }}
- name: test ecr
uses: ./
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
image_name: ${{ env.TEST_IMAGE_NAME }}
registry: ${{ env.ECR_REGISTRY }}
- name: verify ecr
run: |
$(aws ecr get-login --region us-west-2 --no-include-email)
docker pull $ECR_REGISTRY/$TEST_IMAGE_NAME:${{ github.sha }}
docker run $ECR_REGISTRY/$TEST_IMAGE_NAME:${{ github.sha }}
# # Test Docker.io
# # ... similar structure ...