Skip to content

Commit

Permalink
Update GitHub actions versions; Follow strapi versioning
Browse files Browse the repository at this point in the history
jsphpl committed May 9, 2024
1 parent f7f1cff commit dfa70d5
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: Docker build

on:
push:
tags: ["v*"]
@@ -9,49 +7,47 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
name: Docker build and push
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU for cross-platform builds
uses: docker/setup-qemu-action@v3

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

- name: Log in to the Github container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=schedule
type=ref,event=tag
type=semver,pattern=v{{ major }}
type=semver,pattern=v{{ major }}.{{ minor }}
type=semver,pattern=v{{ version }}
type=raw,value=latest,enable={{ is_default_branch }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/arm64, linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
APP_VERSION=${{ github.ref_name }}
cache-from: type=gha
cache-to: type=gha

0 comments on commit dfa70d5

Please sign in to comment.