-
Notifications
You must be signed in to change notification settings - Fork 82
56 lines (49 loc) · 2.25 KB
/
Copy pathdocker.yml
File metadata and controls
56 lines (49 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Publish Docker image
on:
push:
branches: [ release ]
release:
types: [ published ]
# Manual trigger so the multi-arch build can be exercised without cutting
# a release. Pushes to Docker Hub, so run deliberately.
workflow_dispatch:
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v7
- name: Extract WebCalendar Version
id: extract_version
run: echo "::set-output name=version::$(./bump_version.sh -p)"
- name: Set up QEMU
# Emulation for cross-arch (arm64) builds on the amd64 runner.
# Pinned to a commit SHA (supply-chain hardening); Dependabot keeps the
# SHA current via the trailing version comment.
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4
- name: Set up Docker Buildx
# Buildx is required for multi-platform (manifest-list) builds.
# Pinned to a commit SHA (supply-chain hardening); Dependabot keeps the
# SHA current via the trailing version comment.
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4
- name: Log in to Docker Hub
# Pinned to a commit SHA (supply-chain hardening): this action handles
# the Docker Hub token. Dependabot keeps the SHA current via the
# trailing version comment.
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
with:
context: .
file: ./docker/Dockerfile-php8
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:${{ steps.extract_version.outputs.version }}
${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:${{ steps.extract_version.outputs.version }}-php8-apache
${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:latest-php8-apache
${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar:latest