mirror of
https://github.com/N0rthernL1ghts/wordpress.git
synced 2024-11-23 14:13:27 +01:00
Use GitHub actions to build Docker image
This commit is contained in:
parent
d6d9fc4007
commit
431b0572c0
19
.github/workflows/image.yml
vendored
Normal file
19
.github/workflows/image.yml
vendored
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
name: Build stable multiarch image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Login to DockerHub
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
- name: Build image
|
||||||
|
run: bin/build
|
11
bin/build
Executable file
11
bin/build
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
LATEST_TAG="$(git describe --tags --abbrev=0)"
|
||||||
|
WP_VERSION="${1:-$LATEST_TAG}"
|
||||||
|
|
||||||
|
if [ -z "${WP_VERSION}" ]; then
|
||||||
|
echo "Error: WP_VERSION is null"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker build --build-arg WP_VERSION=${WP_VERSION} --push --tag "nlss/wordpress:${WP_VERSION}" --tag "nlss/base-alpine:latest" .
|
Loading…
Reference in New Issue
Block a user