Skip to content

Commit 75789b9

Browse files
committed
Resuse workflow
1 parent 91a8792 commit 75789b9

File tree

3 files changed

+45
-97
lines changed

3 files changed

+45
-97
lines changed

.github/workflows/on-push-to-main.yml

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,10 @@ on:
66
- main
77

88
jobs:
9-
publish_for_platforms:
10-
strategy:
11-
matrix:
12-
include:
13-
- name: Publish for amd64
14-
runner: ubuntu-24.04
15-
platform: linux/amd64
16-
tag: amd64
17-
- name: Publish for arm64
18-
runner: ubuntu-24.04-arm
19-
platform: linux/arm64
20-
tag: arm64
21-
22-
name: ${{ matrix.name }}
23-
runs-on: ${{ matrix.runner }}
24-
25-
steps:
26-
- uses: actions/checkout@v6
27-
28-
- name: Docker Login
29-
uses: docker/login-action@v3.6.0
30-
with:
31-
username: ${{ secrets.DOCKER_USERNAME }}
32-
password: ${{ secrets.DOCKER_ACCESS_TOKEN}}
33-
34-
- name: Build and push docker image
35-
run: docker build --push --platform ${{ matrix.platform }} -t ${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:latest-${{matrix.tag}} ./
36-
37-
publish_multiplatform_manifest:
38-
name: Publish multiplatform manifest
39-
needs: publish_for_platforms
40-
runs-on: ubuntu-latest
41-
steps:
42-
- name: Docker Login
43-
uses: docker/login-action@v3.6.0
44-
with:
45-
username: ${{ secrets.DOCKER_USERNAME }}
46-
password: ${{ secrets.DOCKER_ACCESS_TOKEN}}
47-
48-
- name: Create and push manifest
49-
run: |
50-
docker buildx imagetools create -t ${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:latest \
51-
${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:latest-amd64 \
52-
${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:latest-arm64
9+
publish_production_web_client:
10+
uses: ./.github/workflows/publish-ffxivvenues-web-client.yml
11+
with:
12+
branch: main
13+
tag: latest
14+
docker_username: ${{ secrets.DOCKER_USERNAME }}
15+
docker_password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

.github/workflows/on-push-to-test.yml

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,10 @@ on:
66
- test
77

88
jobs:
9-
publish_for_platforms:
10-
strategy:
11-
matrix:
12-
include:
13-
- name: Publish for amd64
14-
runner: ubuntu-24.04
15-
platform: linux/amd64
16-
tag: amd64
17-
- name: Publish for arm64
18-
runner: ubuntu-24.04-arm
19-
platform: linux/arm64
20-
tag: arm64
21-
22-
name: ${{ matrix.name }}
23-
runs-on: ${{ matrix.runner }}
24-
25-
steps:
26-
- uses: actions/checkout@v6
27-
28-
- name: Docker Login
29-
uses: docker/login-action@v3.6.0
30-
with:
31-
username: ${{ secrets.DOCKER_USERNAME }}
32-
password: ${{ secrets.DOCKER_ACCESS_TOKEN}}
33-
34-
- name: Build and push docker image
35-
run: docker build --push --platform ${{ matrix.platform }} -t ${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:test-${{matrix.tag}} ./
36-
37-
publish_multiplatform_manifest:
38-
name: Publish multiplatform manifest
39-
needs: publish_for_platforms
40-
runs-on: ubuntu-latest
41-
steps:
42-
- name: Docker Login
43-
uses: docker/login-action@v3.6.0
44-
with:
45-
username: ${{ secrets.DOCKER_USERNAME }}
46-
password: ${{ secrets.DOCKER_ACCESS_TOKEN}}
47-
48-
- name: Create and push manifest
49-
run: |
50-
docker buildx imagetools create -t ${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:test \
51-
${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:test-amd64 \
52-
${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:test-arm64
9+
publish_test_web_client:
10+
uses: ./.github/workflows/publish-ffxivvenues-web-client.yml
11+
with:
12+
branch: test
13+
tag: test
14+
docker_username: ${{ secrets.DOCKER_USERNAME }}
15+
docker_password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

.github/workflows/publish-ffxivvenues-web-client.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1-
name: Publish FFXIV Venues Web Client
1+
name: Publish Web Client
22

33
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: Branch to publish from
8+
required: true
9+
type: string
10+
default: main
11+
tag:
12+
description: Tag to publish with
13+
required: true
14+
type: string
15+
default: latest
416
workflow_call:
517
inputs:
618
branch:
@@ -11,6 +23,16 @@ on:
1123
required: true
1224
type: string
1325
default: latest
26+
docker_username:
27+
required: true
28+
type: string
29+
docker_password:
30+
required: true
31+
type: string
32+
33+
env:
34+
DOCKER_USERNAME: ${{ inputs.docker_username || secrets.DOCKER_USERNAME }}
35+
DOCKER_ACCESS_TOKEN: ${{ inputs.docker_password || secrets.DOCKER_ACCESS_TOKEN }}
1436

1537
jobs:
1638
publish_for_platforms:
@@ -37,11 +59,11 @@ jobs:
3759
- name: Docker Login
3860
uses: docker/login-action@v2.0.0
3961
with:
40-
username: ${{ secrets.DOCKER_USERNAME }}
41-
password: ${{ secrets.DOCKER_ACCESS_TOKEN}}
62+
username: ${{ env.DOCKER_USERNAME }}
63+
password: ${{ env.DOCKER_ACCESS_TOKEN}}
4264

4365
- name: Build and push docker image
44-
run: docker build --push --platform ${{ matrix.platform }} -t ${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:${{ inputs.tag }}-${{matrix.tag}} ./
66+
run: docker build --push --platform ${{ matrix.platform }} -t ${{ env.DOCKER_USERNAME }}/ffxivvenues.web:${{ inputs.tag }}-${{matrix.tag}} ./
4567

4668
publish_multiplatform_manifest:
4769
name: Publish multiplatform manifest
@@ -51,11 +73,11 @@ jobs:
5173
- name: Docker Login
5274
uses: docker/login-action@v2.0.0
5375
with:
54-
username: ${{ secrets.DOCKER_USERNAME }}
55-
password: ${{ secrets.DOCKER_ACCESS_TOKEN}}
76+
username: ${{ env.DOCKER_USERNAME }}
77+
password: ${{ env.DOCKER_ACCESS_TOKEN}}
5678

5779
- name: Create and push manifest
5880
run: |
59-
docker buildx imagetools create -t ${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:${{ inputs.tag }} \
60-
${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:${{ inputs.tag }}-amd64 \
61-
${{ secrets.DOCKER_USERNAME }}/ffxivvenues.web:${{ inputs.tag }}-arm64
81+
docker buildx imagetools create -t ${{ env.DOCKER_USERNAME }}/ffxivvenues.web:${{ inputs.tag }} \
82+
${{ env.DOCKER_USERNAME }}/ffxivvenues.web:${{ inputs.tag }}-amd64 \
83+
${{ env.DOCKER_USERNAME }}/ffxivvenues.web:${{ inputs.tag }}-arm64

0 commit comments

Comments
 (0)