-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 1.76 KB
/
verify-transforms.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
52
53
54
55
56
name: Verify XSLT transforms
on:
pull_request:
push:
branches:
- master
tags:
- '*'
jobs:
documentation-check:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check for entry for each XSL in documentation
run: ./scripts/verify-documentation.sh
project-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run tests in docker container
run: |
docker buildx build -t epp-biorxiv-xslt:test --target test .
docker run --rm epp-biorxiv-xslt:test
build-and-push:
needs: [project-tests]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: |
GITHASH=$(git log -1 --pretty=format:"%H")
GITSHORTHASH=$(git log -1 --pretty=format:"%H" | head -c 8)
DATETIME=$(date -u '+%Y%m%d.%H%M')
GITBRANCH=$(git branch --show-current)
docker buildx build \
-t ghcr.io/elifesciences/enhanced-preprints-biorxiv-xslt:latest \
-t ghcr.io/elifesciences/enhanced-preprints-biorxiv-xslt:$GITHASH \
-t ghcr.io/elifesciences/enhanced-preprints-biorxiv-xslt:$GITBRANCH-$GITSHORTHASH-$DATETIME \
--platform linux/amd64,linux/arm64 --push .