-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (79 loc) · 2.39 KB
/
publish.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
81
82
83
84
85
86
87
88
89
90
name: Publish
on:
workflow_dispatch:
push:
jobs:
org-roam-ui:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub Apps token
id: generate
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.generate.outputs.token }}
repository: kijimaD/roam-ui
event-type: commit
tag:
runs-on: ubuntu-latest
outputs:
git-tag: ${{ steps.git-tag.outputs.git-tag }}
steps:
- name: Check out
uses: actions/checkout@v4
- name: Get git tag(short)
id: git-tag
run: |
GIT_TAG=$(git rev-parse --short HEAD)
echo "::set-output name=git-tag::$GIT_TAG"
release_image:
if: github.ref == 'refs/heads/main'
needs: tag
uses: ./.github/workflows/build.yml
with:
image: ghcr.io/kijimad/roam_release:${{ needs.tag.outputs.git-tag }},ghcr.io/kijimad/roam_release:latest
target: release
secrets:
WRITE_PACKAGE: ${{ secrets.WRITE_PACKAGE }}
staging_image:
needs: tag
uses: ./.github/workflows/build.yml
with:
image: ghcr.io/kijimad/roam_staging:${{ needs.tag.outputs.git-tag }},ghcr.io/kijimad/roam_staging:latest
target: staging
secrets:
WRITE_PACKAGE: ${{ secrets.WRITE_PACKAGE }}
build_image:
needs: tag
uses: ./.github/workflows/build.yml
with:
image: ghcr.io/kijimad/roam_build:${{ needs.tag.outputs.git-tag }},ghcr.io/kijimad/roam_build:latest
target: build
secrets:
WRITE_PACKAGE: ${{ secrets.WRITE_PACKAGE }}
publish:
needs:
- tag
- release_image
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4 # publish actions require git
- name: copy
run: |
docker run --detach --name release ghcr.io/kijimad/roam_release:${{ needs.tag.outputs.git-tag }} sleep infinity && \
docker cp release:/roam/public . && \
sudo chown -R $USER:$USER ./public
- name: check
run: |
ls -al ./public
ls -al ./public/pdfs
- name: Publish generated content to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: public