Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit ce6e9a5

Browse files
authored
Merge pull request #11 from reload/build-image
Add Github Action to build and push image
2 parents 0e8e043 + 64f4dc2 commit ce6e9a5

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
on: push
2+
3+
name: Docker build and push
4+
jobs:
5+
6+
build:
7+
name: Docker build and push
8+
# Only run on default branch.
9+
if: >
10+
${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up Docker Buildx
15+
id: buildx
16+
uses: docker/setup-buildx-action@master
17+
- name: Login to DockerHub
18+
uses: docker/login-action@v1
19+
with:
20+
username: ${{ secrets.DOCKERHUB_USERNAME }}
21+
password: ${{ secrets.DOCKERHUB_TOKEN }}
22+
- name: Login to GitHub Container Registry
23+
uses: docker/login-action@v1
24+
with:
25+
registry: ghcr.io
26+
username: ${{ github.repository_owner }}
27+
password: ${{ github.token }}
28+
- name: Build and push Docker images
29+
uses: docker/build-push-action@v2
30+
with:
31+
file: Dockerfile
32+
builder: ${{ steps.buildx.outputs.name }}
33+
push: true
34+
context: .
35+
labels: |
36+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
37+
org.opencontainers.image.version=${{ github.sha }}
38+
org.opencontainers.image.revision=${{ github.sha }}
39+
tags: |
40+
ghcr.io/${{ github.repository }}:latest
41+
reload/drupal-apache-fpm:latest

0 commit comments

Comments
 (0)