-
Notifications
You must be signed in to change notification settings - Fork 291
44 lines (41 loc) · 1.3 KB
/
ci3.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
name: CI3
on:
workflow_dispatch:
# push:
# branches:
# - master
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
- labeled
concurrency:
# force parallelism in master
group: ci3-${{ github.ref_name == 'master' && github.run_id || github.ref_name }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
if: >
(github.event.action != 'labeled' && github.event.pull_request.draft == false) ||
(github.event.action == 'labeled' && github.event.label.name == 'trigger-workflow')
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Ensure it is not an artificial merge commit
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup
run: |
# Ensure we can SSH into the spot instances we request
mkdir -p ~/.ssh
echo ${{ secrets.BUILD_INSTANCE_SSH_KEY }} | base64 --decode > ~/.ssh/build_instance_key
chmod 600 ~/.ssh/build_instance_key
- name: Run
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
BRANCH=${{ github.event.pull_request.head.ref || github.ref_name }} ./ci.sh ec2