-
Notifications
You must be signed in to change notification settings - Fork 2
31 lines (29 loc) · 1.04 KB
/
tag.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
name: Docker Build
on:
push:
tags:
- '*'
jobs:
build-and-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build and Push Image to Registry
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
REPOSITORY: luthermonson/php-docker-skeleton
REF: ${{ github.ref }}
REGISTRY: ghcr.io
run: |
# php app
TAG=${REF##*/}
echo "$REGISTRY_PASSWORD" | docker login $REGISTRY -u "$REGISTRY_USERNAME" --password-stdin
docker build -t $REGISTRY/$REPOSITORY:php-$TAG -f Dockerfile .
docker push $REGISTRY/$REPOSITORY:php-$TAG
echo "::set-output name=image::$REGISTRY/$REPOSITORY:php-$TAG"
# static assets
docker build -t $REGISTRY/$REPOSITORY:nginx-$TAG -f Dockerfile.nginx .
docker push $REGISTRY/$REPOSITORY:nginx-$TAG
echo "::set-output name=image::$REGISTRY/$REPOSITORY:nginx-$TAG"