-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 1.08 KB
/
preview-build.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
name: Preview
on:
pull_request:
types: [labeled, synchronize, opened, reopened]
jobs:
build-preview-image:
runs-on: ubuntu-20.04
if: ${{ contains(github.event.pull_request.labels.*.name, 'preview') }}
steps:
- uses: actions/checkout@v4
- name: Get sha with 8 chars long
id: commit_sha
run: echo "commit_sha=${GITHUB_SHA:0:8}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
platforms: linux/amd64
tags: |
ghcr.io/elifesciences/enhanced-preprints:preview-${{ steps.commit_sha.outputs.commit_sha }}
ghcr.io/elifesciences/enhanced-preprints-server:preview-${{ steps.commit_sha.outputs.commit_sha }}