-
Notifications
You must be signed in to change notification settings - Fork 5
51 lines (45 loc) · 1.37 KB
/
pr.yaml
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
50
51
name: Build and test PR
on:
pull_request:
types:
- opened
- synchronize
- ready_for_review
- reopened
branches:
- main
jobs:
# This job exists so that PRs from outside the main repo are rejected
fail_on_remote:
runs-on: ubuntu-latest
steps:
- name: PR must be from a branch in the azimuth-cloud/azimuth-images repo
run: exit ${{ github.repository == 'azimuth-cloud/azimuth-images' && '0' || '1' }}
# Build, publish and test the images
build_test_images:
needs: [fail_on_remote]
# Don't build draft PRs
if: ${{ !github.event.pull_request.draft }}
uses: ./.github/workflows/build_test_images.yaml
secrets: inherit
# Purge the manifest and images that we just tested from S3
purge_images:
needs: [build_test_images]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install s3cmd
run: |
sudo apt-get update -y
sudo apt-get install -y s3cmd
- name: Purge tested images from S3
run: |
source ./bin/env-vars
./bin/purge-manifest "${GITHUB_SHA}.manifest"
env:
REPO_ROOT: ${{ github.workspace }}
ENVIRONMENT: arcus
ENV_VAR_FILES: common
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}