-
Notifications
You must be signed in to change notification settings - Fork 40
67 lines (59 loc) · 1.82 KB
/
release.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
name: Generate Pdf and Release
# refer to https://github.com/actions/starter-workflows/blob/main/ci/docker-publish.yml
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
paths-ignore:
- '**.html'
- 'static/**'
- 'no_used/**'
env:
CACHE_FROM_DIR: /tmp/.buildx-cache
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Docker Buildx
id: buildx
# Use the action from the master, as we've seen some inconsistencies with @v1
# Issue: https://github.com/docker/build-push-action/issues/286
uses: docker/setup-buildx-action@master
# Only worked for us with this option on 🤷♂️
with:
install: true
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: ${{ env.CACHE_FROM_DIR }}
# Key is named differently to avoid collision
key: ${{ runner.os }}-multi-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-multi-buildx
- name: Init
run: |
mkdir -p output
# Build and push Docker image with Buildx (don't push on PR)
- name: Build And Gen Pdf
working-directory: ./
run: ./gen_pdf.sh
- name: Generate release tag
id: tag
run: |
echo "::set-output name=release_tag::UserBuild_$(date +"%Y.%m.%d_%H-%M")"
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.release_tag }}
files: ./output/${{ github.sha }}.pdf
draft: false
prerelease: true