-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.75 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
name: Create Release
on:
push:
branches:
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: thepinion/nspyc-pandoc
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Date Now
run: bash set_date_now.sh
- name: Set up Docker
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Run Container and Generate PDF
run: docker run -v ${{ github.workspace }}/output:/data/output ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
- name: Extract release version
id: extract_value
run: |
RELEASE_VERSION=$(grep 'subtitle:' convention.md | awk '{print $NF}')
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: ${{ secrets.RELEASE_TOKEN }}
prerelease: false
automatic_release_tag: ${{ github.ref_name }}-${{ env.RELEASE_VERSION }}
files: |
output/convention.pdf