-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.05 KB
/
push_image.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Push Image
on:
push:
branches:
- "master"
jobs:
push_image:
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
strategy:
matrix:
target: ["pandoc", "printout"]
steps:
- name: checkout
uses: actions/checkout@v2
- name: create tag
run: |
SHA=${{ github.sha }}
TAG=$(TZ=UTC-9 date '+%Y%m')-${SHA:0:7}
echo "TAGS=$TAG" >> $GITHUB_ENV
echo TAG $TAG
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ github.ref }}-${{ github.sha }}
${{ github.ref }}
refs/head/master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./${{ matrix.target }}
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/${{ matrix.target }}:latest
cache-from: type=local,src=/tmp/${{ matrix.target }}/.buildx-cache
cache-to: type=local,dest=/tmp/${{ matrix.target }}/.buildx-cache
test:
needs: push_image
runs-on: ubuntu-20.04
steps:
- name: Set DATE
run: echo "DATE=$(date '+%Y%m%d-%H%M%S')" >> $GITHUB_ENV
- name: chackout
uses: actions/checkout@v2
- name: Convert file markdown to pdf
run: |
make setup
make test_base
make CTN1=ghcr.io/i13302/pandoc:latest CTN2=ghcr.io/i13302/printout:latest test_run
make test_check
- name: Upload file pdf.
uses: actions/upload-artifact@master
with:
name: PDFTEST-${{ env.DATE }}
path: test/pdf/*.pdf