Skip to content

Commit 4e4c5ca

Browse files
Publish docs as a separate workflow
1 parent 694ecde commit 4e4c5ca

File tree

3 files changed

+60
-82
lines changed

3 files changed

+60
-82
lines changed

.github/workflows/build_artifacts.yml

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88

99
jobs:
10-
build-mod:
10+
build:
1111
runs-on: ubuntu-latest
1212

1313
steps:
@@ -52,43 +52,3 @@ jobs:
5252
with:
5353
name: Artifacts
5454
path: build/libs/
55-
56-
publish-docs:
57-
runs-on: ubuntu-latest
58-
steps:
59-
- uses: actions/checkout@v4
60-
61-
- name: Store short commit hash
62-
run: echo "short_commit_hash=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
63-
64-
- uses: danielr1996/envsubst-action@1.1.0
65-
env:
66-
URL_PREFIX: staging-
67-
SHORT_COMMIT_HASH: ${{ env.short_commit_hash }}
68-
with:
69-
input: docker-compose-template.yml
70-
output: docker-compose.yml
71-
72-
- name: Login to container registry
73-
uses: docker/login-action@v3
74-
with:
75-
registry: registry.oracle.offsetmonkey538.top
76-
username: ${{ secrets.REGISTRY_USER }}
77-
password: ${{ secrets.REGISTRY_PASSWORD }}
78-
79-
- name: Set up Docker Buildx
80-
uses: docker/setup-buildx-action@v3
81-
82-
- name: Build and push
83-
uses: docker/build-push-action@v6
84-
with:
85-
context: .
86-
push: true
87-
tags: registry.oracle.offsetmonkey538.top/loot-table-modifier/docs:${{ env.short_commit_hash }}
88-
89-
- run: |
90-
tar -czf archive.tar.gz docker-compose.yml && curl -i -X POST -H "Authorization: Bearer $SEELF_TOKEN" -F environment=$SEELF_ENVIRONMENT -F archive=@archive.tar.gz $SEELF_APPLICATION_URL
91-
env:
92-
SEELF_TOKEN: ${{ secrets.SEELF_TOKEN }}
93-
SEELF_ENVIRONMENT: staging
94-
SEELF_APPLICATION_URL: https://seelf.oracle.offsetmonkey538.top/api/v1/apps/300qBnG3t1dOFrUGfw1EeWYwKYA/deployments

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish docs
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
release:
8+
types: [published]
9+
10+
11+
jobs:
12+
publish-docs:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set url prefix
18+
run: |
19+
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
20+
echo "url_prefix=staging-" >> "$GITHUB_ENV"
21+
else
22+
echo "url_prefix=" >> "$GITHUB_ENV"
23+
fi
24+
25+
- name: Store short commit hash
26+
run: echo "short_commit_hash=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
27+
28+
- uses: danielr1996/envsubst-action@1.1.0
29+
env:
30+
URL_PREFIX: ${{ env.url_prefix }}
31+
SHORT_COMMIT_HASH: ${{ env.short_commit_hash }}
32+
with:
33+
input: docker-compose-template.yml
34+
output: docker-compose.yml
35+
36+
- name: Login to container registry
37+
uses: docker/login-action@v3
38+
with:
39+
registry: registry.oracle.offsetmonkey538.top
40+
username: ${{ secrets.REGISTRY_USER }}
41+
password: ${{ secrets.REGISTRY_PASSWORD }}
42+
43+
- name: Set up Docker Buildx
44+
uses: docker/setup-buildx-action@v3
45+
46+
- name: Build and push
47+
uses: docker/build-push-action@v6
48+
with:
49+
context: .
50+
push: true
51+
tags: registry.oracle.offsetmonkey538.top/loot-table-modifier/docs:${{ env.short_commit_hash }}
52+
53+
- run: |
54+
tar -czf archive.tar.gz docker-compose.yml && curl -i -X POST -H "Authorization: Bearer $SEELF_TOKEN" -F environment=$SEELF_ENVIRONMENT -F archive=@archive.tar.gz $SEELF_APPLICATION_URL
55+
env:
56+
SEELF_TOKEN: ${{ secrets.SEELF_TOKEN }}
57+
SEELF_ENVIRONMENT: staging
58+
SEELF_APPLICATION_URL: https://seelf.oracle.offsetmonkey538.top/api/v1/apps/300qBnG3t1dOFrUGfw1EeWYwKYA/deployments

.github/workflows/publish.yml

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77

88
jobs:
9-
publish-mod:
9+
publish:
1010
runs-on: ubuntu-latest
1111

1212
permissions:
@@ -62,43 +62,3 @@ jobs:
6262
CUSTOM_VERSION: ${{ env.short_commit_hash }}
6363
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
6464
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
65-
66-
publish-docs:
67-
runs-on: ubuntu-latest
68-
steps:
69-
- uses: actions/checkout@v4
70-
71-
- name: Store short commit hash
72-
run: echo "short_commit_hash=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
73-
74-
- uses: danielr1996/envsubst-action@1.1.0
75-
env:
76-
URL_PREFIX: ""
77-
SHORT_COMMIT_HASH: ${{ env.short_commit_hash }}
78-
with:
79-
input: docker-compose-template.yml
80-
output: docker-compose.yml
81-
82-
- name: Login to container registry
83-
uses: docker/login-action@v3
84-
with:
85-
registry: registry.oracle.offsetmonkey538.top
86-
username: ${{ secrets.REGISTRY_USER }}
87-
password: ${{ secrets.REGISTRY_PASSWORD }}
88-
89-
- name: Set up Docker Buildx
90-
uses: docker/setup-buildx-action@v3
91-
92-
- name: Build and push
93-
uses: docker/build-push-action@v6
94-
with:
95-
context: .
96-
push: true
97-
tags: registry.oracle.offsetmonkey538.top/loot-table-modifier/docs:${{ env.short_commit_hash }}
98-
99-
- run: |
100-
tar -czf archive.tar.gz docker-compose.yml && curl -i -X POST -H "Authorization: Bearer $SEELF_TOKEN" -F environment=$SEELF_ENVIRONMENT -F archive=@archive.tar.gz $SEELF_APPLICATION_URL
101-
env:
102-
SEELF_TOKEN: ${{ secrets.SEELF_TOKEN }}
103-
SEELF_ENVIRONMENT: staging
104-
SEELF_APPLICATION_URL: https://seelf.oracle.offsetmonkey538.top/api/v1/apps/300qBnG3t1dOFrUGfw1EeWYwKYA/deployments

0 commit comments

Comments
 (0)