-
-
Notifications
You must be signed in to change notification settings - Fork 283
33 lines (32 loc) · 1018 Bytes
/
docker.yaml
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
name: Docker
on:
# We try to build image on each PR.
pull_request: ~
# When tagged, we also push the image to the docker registry.
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
name: Docker image build
env:
publish: ${{ github.event_name == 'push' }}
repository: 'nunomaduro/phpinsights'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Release version
run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV
if: ${{ env.publish == 'true' }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
tags: ${{ env.repository }}:latest , ${{ env.repository }}:${{ env.RELEASE_VERSION }}
push: ${{ env.publish == 'true' }}