-
Notifications
You must be signed in to change notification settings - Fork 6
35 lines (32 loc) · 1.08 KB
/
pull_request.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
name: Build image from pull request
on:
pull_request:
branches:
- master
env:
GCS_BUCKET: images.metal-pod.io
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- uses: google-github-actions/setup-gcloud@v0
with:
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
- name: Build image
uses: metal-stack/action-docker-make@master
with:
args: >
--no-cache
--no-lint
--no-push
--summary
- name: Prepare image upload
run: |
export PULL_REQUEST_NUMBER=$(echo "$GITHUB_REF" | awk -F / '{print $3}')
mkdir -p images/metal-hammer/pull-requests/${PULL_REQUEST_NUMBER}-${GITHUB_HEAD_REF##*/}
mv metal-hammer-initrd.img.lz4* images/metal-hammer/pull-requests/${PULL_REQUEST_NUMBER}-${GITHUB_HEAD_REF##*/}/
- name: Upload image tarballs to GCS
run: gsutil -m cp -r -p images/metal-hammer gs://$GCS_BUCKET