Skip to content

Commit aec8ef7

Browse files
authored
Merge pull request #348 from rjhenry/rjh_actions
Update metadata-action to v4
2 parents dfd1266 + 3bf1eb1 commit aec8ef7

File tree

3 files changed

+63
-18
lines changed

3 files changed

+63
-18
lines changed

.github/workflows/master.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v3
14+
1415
- name: Set up CI Image Metadata
1516
id: docker_meta_ci
16-
uses: crazy-max/ghaction-docker-meta@v1
17+
uses: docker/metadata-action@v4
1718
with:
1819
images: solidnerd/bookstack-dev
19-
tag-sha: true
20+
tags: |
21+
type=sha
22+
2023
- name: Set up Docker Buildx
2124
uses: docker/setup-buildx-action@v2
25+
2226
- name: Build Image
2327
uses: docker/build-push-action@v3
2428
with:
@@ -31,42 +35,49 @@ jobs:
3135
labels: ${{ steps.docker_meta_ci.outputs.labels }}
3236
cache-from: type=registry,ref=solidnerd/bookstack-dev:master
3337
outputs: type=docker,dest=/tmp/image-bookstack.tar
38+
3439
- name: Upload artifact
3540
uses: actions/upload-artifact@v3
3641
with:
3742
name: image-bookstack-master
3843
path: /tmp/image-bookstack.tar
3944
if-no-files-found: warn
45+
4046
e2e:
4147
runs-on: ubuntu-latest
4248
needs: build
4349
steps:
4450
- name: Checkout
4551
uses: actions/checkout@v3
52+
4653
- name: Download artifact
4754
uses: actions/download-artifact@v3
4855
with:
4956
name: image-bookstack-master
5057
path: /tmp
58+
5159
- name: Load Docker image
5260
run: |
5361
docker load --input /tmp/image-bookstack.tar
5462
docker image ls -a
63+
5564
push:
5665
runs-on: ubuntu-20.04
5766
needs: e2e
5867
steps:
5968
- name: Checkout
6069
uses: actions/checkout@v3
70+
6171
- name: Set up Docker Hub Image Metadata
6272
id: docker_meta
63-
uses: crazy-max/ghaction-docker-meta@v1
73+
uses: docker/metadata-action@v4
6474
with:
6575
images: solidnerd/bookstack,ghcr.io/solidnerd/docker-bookstack
66-
tag-semver: |
67-
{{version}}
68-
{{major}}.{{minor}}
69-
{{major}}.{{minor}}.{{patch}}
76+
tags: |
77+
type=semver,pattern={{version}}
78+
type=semver,pattern={{major}}.{{minor}}
79+
type=semver,pattern={{major}}.{{minor}}.{{patch}}
80+
7081
- name: Download artifact
7182
uses: actions/download-artifact@v3
7283
with:
@@ -77,22 +88,27 @@ jobs:
7788
run: |
7889
docker load --input /tmp/image-bookstack.tar
7990
docker image ls -a
91+
8092
- name: Set up QEMU
8193
uses: docker/setup-qemu-action@v2
94+
8295
- name: Set up Docker Buildx
8396
uses: docker/setup-buildx-action@v2
97+
8498
- name: Login to DockerHub
8599
if: github.event_name != 'pull_request'
86100
uses: docker/login-action@v2
87101
with:
88102
username: ${{ secrets.DOCKER_USERNAME }}
89103
password: ${{ secrets.DOCKER_PASSWORD }}
104+
90105
- name: Login to GitHub Container Registry
91-
uses: docker/login-action@v2
106+
uses: docker/login-action@v2
92107
with:
93108
registry: ghcr.io
94109
username: ${{ github.repository_owner }}
95110
password: ${{ secrets.CR_PAT }}
111+
96112
- name: Build and Push
97113
uses: docker/build-push-action@v3
98114
with:

.github/workflows/pr.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v3
14+
1415
- name: Docker meta ci
1516
id: docker_meta_ci
16-
uses: crazy-max/ghaction-docker-meta@v1
17+
uses: docker/metadata-action@v4
1718
with:
1819
images: solidnerd/bookstack-dev
19-
tag-sha: true
20+
tags: |
21+
type=sha
22+
2023
- name: Set up Docker Buildx
2124
uses: docker/setup-buildx-action@v2
25+
2226
- name: Build and push Dev
2327
uses: docker/build-push-action@v3
2428
with:
@@ -32,27 +36,32 @@ jobs:
3236
cache-from: type=registry,ref=solidnerd/bookstack-dev:master
3337
cache-to: type=inline
3438
outputs: type=docker,dest=/tmp/image-bookstack.tar
39+
3540
- name: Upload artifact
3641
uses: actions/upload-artifact@v3
3742
with:
3843
name: image-bookstack
3944
path: /tmp/image-bookstack.tar
4045
if-no-files-found: warn
46+
4147
e2e:
4248
runs-on: ubuntu-latest
4349
needs: build
4450
steps:
4551
- name: Checkout
4652
uses: actions/checkout@v3
53+
4754
- name: Download artifact
4855
uses: actions/download-artifact@v3
4956
with:
5057
name: image-bookstack
5158
path: /tmp
5259
if-no-files-found: warn
60+
5361
- name: Load Docker image
5462
run: |
5563
docker load --input /tmp/image-bookstack.tar
5664
docker image ls -a
65+
5766
- name: Execute End-to-End Test
5867
run: make e2e

.github/workflows/release.yml

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v3
14+
1415
- name: Set up CI Image Metadata
1516
id: docker_meta_ci
16-
uses: crazy-max/ghaction-docker-meta@v1
17+
uses: docker/metadata-action@v4
1718
with:
1819
images: solidnerd/bookstack-dev
19-
tag-sha: true
20+
tags: |
21+
type=sha
22+
2023
- name: Set up Docker Buildx
2124
uses: docker/setup-buildx-action@v2
25+
2226
- name: Build and push Dev
2327
uses: docker/build-push-action@v3
2428
with:
@@ -31,66 +35,79 @@ jobs:
3135
labels: ${{ steps.docker_meta_ci.outputs.labels }}
3236
cache-from: type=registry,ref=solidnerd/bookstack-dev:master
3337
outputs: type=docker,dest=/tmp/image-bookstack.tar
38+
3439
- name: Upload artifact
3540
uses: actions/upload-artifact@v3
3641
with:
3742
name: image-bookstack-master
3843
path: /tmp/image-bookstack.tar
44+
3945
e2e:
4046
runs-on: ubuntu-latest
4147
needs: build
4248
steps:
4349
- name: Checkout
4450
uses: actions/checkout@v3
51+
4552
- name: Download artifact
4653
uses: actions/download-artifact@v3
4754
with:
4855
name: image-bookstack-master
4956
path: /tmp
57+
5058
- name: Load Docker image
5159
run: |
5260
docker load --input /tmp/image-bookstack.tar
5361
docker image ls -a
62+
5463
push:
5564
runs-on: ubuntu-20.04
5665
needs: e2e
5766
steps:
5867
- name: Checkout
5968
uses: actions/checkout@v3
69+
6070
- name: Set up Docker Hub Image Metadata
6171
id: docker_meta
62-
uses: crazy-max/ghaction-docker-meta@v1
72+
uses: docker/metadata-action@v4
6373
with:
6474
images: solidnerd/bookstack,ghcr.io/solidnerd/docker-bookstack
65-
tag-semver: |
66-
{{version}}
67-
{{major}}.{{minor}}
68-
{{major}}.{{minor}}.{{patch}}
75+
tags:
76+
type=semver,pattern={{version}}
77+
type=semver,pattern={{major}}.{{minor}}
78+
type=semver,pattern={{major}}.{{minor}}.{{patch}}
79+
6980
- name: Download artifact
7081
uses: actions/download-artifact@v3
7182
with:
7283
name: image-bookstack-master
7384
path: /tmp
85+
7486
- name: Load Docker image
7587
run: |
7688
docker load --input /tmp/image-bookstack.tar
7789
docker image ls -a
90+
7891
- name: Set up QEMU
7992
uses: docker/setup-qemu-action@v2
93+
8094
- name: Set up Docker Buildx
8195
uses: docker/setup-buildx-action@v2
96+
8297
- name: Login to DockerHub
8398
if: github.event_name != 'pull_request'
8499
uses: docker/login-action@v2
85100
with:
86101
username: ${{ secrets.DOCKER_USERNAME }}
87102
password: ${{ secrets.DOCKER_PASSWORD }}
103+
88104
- name: Login to GitHub Container Registry
89-
uses: docker/login-action@v2
105+
uses: docker/login-action@v2
90106
with:
91107
registry: ghcr.io
92108
username: ${{ github.repository_owner }}
93109
password: ${{ secrets.CR_PAT }}
110+
94111
- name: Build and Push master
95112
uses: docker/build-push-action@v3
96113
with:
@@ -103,18 +120,21 @@ jobs:
103120
labels: ${{ steps.docker_meta.outputs.labels }}
104121
cache-from: type=registry,ref=solidnerd/bookstack-dev:${{ github.sha }}
105122
cache-to: type=registry,ref=solidnerd/bookstack-dev:${{ github.sha }}
123+
106124
create-release:
107125
runs-on: ubuntu-20.04
108126
needs: push
109127
steps:
110128
# To use this repository's private action, you must check out the repository
111129
- name: Checkout
112130
uses: actions/checkout@v3
131+
113132
- name: Generate changelog
114133
id: changelog
115134
uses: metcalfc/changelog-generator@v3.0.0
116135
with:
117136
myToken: ${{ secrets.GITHUB_TOKEN }}
137+
118138
- name: Create Release
119139
id: create_release
120140
uses: actions/create-release@v1.1.4

0 commit comments

Comments
 (0)