Skip to content

Update metadata-action to v4 #348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up CI Image Metadata
id: docker_meta_ci
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
images: solidnerd/bookstack-dev
tag-sha: true
tags: |
type=sha

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Image
uses: docker/build-push-action@v3
with:
Expand All @@ -31,42 +35,49 @@ jobs:
labels: ${{ steps.docker_meta_ci.outputs.labels }}
cache-from: type=registry,ref=solidnerd/bookstack-dev:master
outputs: type=docker,dest=/tmp/image-bookstack.tar

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: image-bookstack-master
path: /tmp/image-bookstack.tar
if-no-files-found: warn

e2e:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: image-bookstack-master
path: /tmp

- name: Load Docker image
run: |
docker load --input /tmp/image-bookstack.tar
docker image ls -a

push:
runs-on: ubuntu-20.04
needs: e2e
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Hub Image Metadata
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
images: solidnerd/bookstack,ghcr.io/solidnerd/docker-bookstack
tag-semver: |
{{version}}
{{major}}.{{minor}}
{{major}}.{{minor}}.{{patch}}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}

- name: Download artifact
uses: actions/download-artifact@v3
with:
Expand All @@ -77,22 +88,27 @@ jobs:
run: |
docker load --input /tmp/image-bookstack.tar
docker image ls -a

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Build and Push
uses: docker/build-push-action@v3
with:
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Docker meta ci
id: docker_meta_ci
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
images: solidnerd/bookstack-dev
tag-sha: true
tags: |
type=sha

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Dev
uses: docker/build-push-action@v3
with:
Expand All @@ -32,27 +36,32 @@ jobs:
cache-from: type=registry,ref=solidnerd/bookstack-dev:master
cache-to: type=inline
outputs: type=docker,dest=/tmp/image-bookstack.tar

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: image-bookstack
path: /tmp/image-bookstack.tar
if-no-files-found: warn

e2e:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: image-bookstack
path: /tmp
if-no-files-found: warn

- name: Load Docker image
run: |
docker load --input /tmp/image-bookstack.tar
docker image ls -a

- name: Execute End-to-End Test
run: make e2e
36 changes: 28 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up CI Image Metadata
id: docker_meta_ci
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
images: solidnerd/bookstack-dev
tag-sha: true
tags: |
type=sha

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push Dev
uses: docker/build-push-action@v3
with:
Expand All @@ -31,66 +35,79 @@ jobs:
labels: ${{ steps.docker_meta_ci.outputs.labels }}
cache-from: type=registry,ref=solidnerd/bookstack-dev:master
outputs: type=docker,dest=/tmp/image-bookstack.tar

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: image-bookstack-master
path: /tmp/image-bookstack.tar

e2e:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: image-bookstack-master
path: /tmp

- name: Load Docker image
run: |
docker load --input /tmp/image-bookstack.tar
docker image ls -a

push:
runs-on: ubuntu-20.04
needs: e2e
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Hub Image Metadata
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v4
with:
images: solidnerd/bookstack,ghcr.io/solidnerd/docker-bookstack
tag-semver: |
{{version}}
{{major}}.{{minor}}
{{major}}.{{minor}}.{{patch}}
tags:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: image-bookstack-master
path: /tmp

- name: Load Docker image
run: |
docker load --input /tmp/image-bookstack.tar
docker image ls -a

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Build and Push master
uses: docker/build-push-action@v3
with:
Expand All @@ -103,18 +120,21 @@ jobs:
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=registry,ref=solidnerd/bookstack-dev:${{ github.sha }}
cache-to: type=registry,ref=solidnerd/bookstack-dev:${{ github.sha }}

create-release:
runs-on: ubuntu-20.04
needs: push
steps:
# To use this repository's private action, you must check out the repository
- name: Checkout
uses: actions/checkout@v3

- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
id: create_release
uses: actions/[email protected]
Expand Down